Skip to content

Commit 518d90b

Browse files
committed
lint: Blacken all the strings
1 parent 8af6ca5 commit 518d90b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1355
-1356
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ repos:
3636
hooks:
3737
- id: black
3838
language_version: python3.6
39-
args: [--skip-string-normalization]
4039
exclude: .*/migrations/.*

docs/source/conf.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
project = 'Junction'
2-
copyright = '2019, Junction Developers'
3-
author = 'Junction Developers'
1+
project = "Junction"
2+
copyright = "2019, Junction Developers"
3+
author = "Junction Developers"
44

55

66
# -- General configuration ---------------------------------------------------
77

88
# Add any Sphinx extension module names here, as strings. They can be
99
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
1010
# ones.
11-
extensions = ['recommonmark']
11+
extensions = ["recommonmark"]
1212

1313
# Add any paths that contain templates here, relative to this directory.
14-
templates_path = ['_templates']
14+
templates_path = ["_templates"]
1515

1616
# List of patterns, relative to source directory, that match files and
1717
# directories to ignore when looking for source files.
@@ -20,21 +20,21 @@
2020

2121
# The suffix of source filenames.
2222
source_suffix = {
23-
'.rst': 'restructuredtext',
24-
'.md': 'markdown',
23+
".rst": "restructuredtext",
24+
".md": "markdown",
2525
}
2626

2727
# -- Options for HTML output -------------------------------------------------
2828

2929
# The theme to use for HTML and HTML Help pages. See the documentation for
3030
# a list of builtin themes.
3131
#
32-
html_theme = 'alabaster'
32+
html_theme = "alabaster"
3333

3434
# Add any paths that contain custom static files (such as style sheets) here,
3535
# relative to this directory. They are copied after the builtin static files,
3636
# so a file named "default.css" will overwrite the builtin "default.css".
37-
html_static_path = ['_static']
37+
html_static_path = ["_static"]
3838

3939
# -- Recommonmark/Markdown stuff ---------------------------------------------
4040
# NOTE: This entire section should be removed once the old/ folder is removed
@@ -44,5 +44,5 @@
4444

4545

4646
def setup(app):
47-
app.add_config_value('recommonmark_config', {'enable_auto_toc_tree': True,}, True)
47+
app.add_config_value("recommonmark_config", {"enable_auto_toc_tree": True,}, True)
4848
app.add_transform(AutoStructify)

junction/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
2-
__version__ = '0.3.2'
2+
__version__ = "0.3.2"
33
__version_info__ = tuple(
44
[
55
int(num) if num.isdigit() else num
6-
for num in __version__.replace('-', '.', 1).split('.')
6+
for num in __version__.replace("-", ".", 1).split(".")
77
]
88
)
99

junction/base/admin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ def save_model(self, request, obj, form, change):
1717

1818
class TimeAuditAdmin(admin.ModelAdmin):
1919
list_display = (
20-
'created_at',
21-
'modified_at',
20+
"created_at",
21+
"modified_at",
2222
)
2323

2424

2525
class AuditAdmin(TimeAuditAdmin):
26-
list_display = ('created_by', 'modified_by',) + TimeAuditAdmin.list_display
26+
list_display = ("created_by", "modified_by",) + TimeAuditAdmin.list_display
2727
exclude = (
28-
'created_by',
29-
'modified_by',
28+
"created_by",
29+
"modified_by",
3030
)
3131

3232
def save_model(self, request, obj, form, change):

junction/base/constants.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def _user_attributes(cls):
8-
defaults = dir(type(str('defaults'), (object,), {})) # gives all inbuilt attrs
8+
defaults = dir(type(str("defaults"), (object,), {})) # gives all inbuilt attrs
99
return [item[0] for item in inspect.getmembers(cls) if item[0] not in defaults]
1010

1111

@@ -18,7 +18,7 @@ def choices(cls):
1818
val = getattr(cls, attr)
1919
setattr(cls, attr[1:], val[0])
2020
_choices.append((val[0], val[1]))
21-
setattr(cls, 'CHOICES', tuple(_choices))
21+
setattr(cls, "CHOICES", tuple(_choices))
2222
return cls
2323

2424

@@ -70,8 +70,8 @@ class ProposalReviewVote:
7070
# FIXME: `ProposalReviewerComment` should be Boolean
7171
@choices
7272
class ProposalReviewerComment:
73-
_COMMENTED = ['True', 'Yes']
74-
_NOT_COMMENTED = ['False', 'No']
73+
_COMMENTED = ["True", "Yes"]
74+
_NOT_COMMENTED = ["False", "No"]
7575

7676

7777
@choices
@@ -105,11 +105,11 @@ class ConferenceSettingConstants:
105105

106106
@choices
107107
class PSRVotePhase:
108-
_PRIMARY = [0, 'Initial voting']
109-
_SECONDARY = [1, 'Second phase voting']
108+
_PRIMARY = [0, "Initial voting"]
109+
_SECONDARY = [1, "Second phase voting"]
110110

111111

112112
@choices
113113
class ProposalCommentType:
114-
_GENERAL = [0, 'All general comments']
115-
_SECONDARY_VOTING = [1, 'Second phase voting']
114+
_GENERAL = [0, "All general comments"]
115+
_SECONDARY_VOTING = [1, "Second phase voting"]

junction/base/context_processors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66

77
def site_info(request):
8-
return {'SITE_INFO': settings.SITE_VARIABLES}
8+
return {"SITE_INFO": settings.SITE_VARIABLES}

junction/base/emailer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def send_email(to, context, template_dir):
2323
def to_str(template_name):
2424
return render_to_string(path.join(template_dir, template_name), context).strip()
2525

26-
subject = to_str('subject.txt')
27-
text_message = to_str('message.txt')
28-
html_message = to_str('message.html')
26+
subject = to_str("subject.txt")
27+
text_message = to_str("message.txt")
28+
html_message = to_str("message.html")
2929
from_email = settings.DEFAULT_FROM_EMAIL
3030
recipient_list = [_format_email(to)]
3131

junction/base/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class UserAuditModel(models.Model):
2222

2323
created_by = models.ForeignKey(
2424
User,
25-
related_name='created_%(class)s_set',
25+
related_name="created_%(class)s_set",
2626
null=True,
2727
blank=True,
2828
verbose_name="Created By",
2929
)
3030
modified_by = models.ForeignKey(
3131
User,
32-
related_name='updated_%(class)s_set',
32+
related_name="updated_%(class)s_set",
3333
null=True,
3434
blank=True,
3535
verbose_name="Modified By",

junction/base/utils.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,39 @@
33

44
def get_date_diff_display(start, end):
55
if end.year != start.year:
6-
return '%s - %s' % (start.strftime('%-d %b %Y'), end.strftime('%-d %b %Y'))
6+
return "%s - %s" % (start.strftime("%-d %b %Y"), end.strftime("%-d %b %Y"))
77

88
# year are same now
99
if end.month != start.month:
10-
return '%s - %s, %s' % (
11-
start.strftime('%-d %b'),
12-
end.strftime('%-d %b'),
10+
return "%s - %s, %s" % (
11+
start.strftime("%-d %b"),
12+
end.strftime("%-d %b"),
1313
start.year,
1414
)
1515

1616
# month and year are same now
1717
if end.day != start.day:
18-
return '%s-%s %s, %s' % (
19-
start.strftime('%d'),
20-
end.strftime('%d'),
21-
start.strftime('%b'),
18+
return "%s-%s %s, %s" % (
19+
start.strftime("%d"),
20+
end.strftime("%d"),
21+
start.strftime("%b"),
2222
start.year,
2323
)
2424

2525
# day, month and year are same now
2626
if isinstance(start, dt.date):
27-
return '%s' % (start.strftime('%-d %b %Y'))
27+
return "%s" % (start.strftime("%-d %b %Y"))
2828

2929
# am/pm, day, month and year are same now
30-
if end.strftime('%p') != start.strftime('%p'):
31-
return '%s - %s, %s' % (
32-
start.strftime('%-I:%M%p'),
33-
end.strftime('%-I:%M%p'),
34-
start.strftime('%-d %b %Y'),
30+
if end.strftime("%p") != start.strftime("%p"):
31+
return "%s - %s, %s" % (
32+
start.strftime("%-I:%M%p"),
33+
end.strftime("%-I:%M%p"),
34+
start.strftime("%-d %b %Y"),
3535
)
3636

37-
return '%s - %s%s' % (
38-
start.strftime('%-I:%M'),
39-
end.strftime('%-I:%M'),
40-
start.strftime('%p, %-d %b %Y'),
37+
return "%s - %s%s" % (
38+
start.strftime("%-I:%M"),
39+
end.strftime("%-I:%M"),
40+
start.strftime("%p, %-d %b %Y"),
4141
)

junction/celery_app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
from django.conf import settings
88

99
# set the default Django settings module for the 'celery' program.
10-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
10+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
1111

12-
app = Celery('junction')
12+
app = Celery("junction")
1313

1414
# Using a string here means the worker will not have to
1515
# pickle the object when using Windows.
16-
app.config_from_object('settings')
16+
app.config_from_object("settings")
1717
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

0 commit comments

Comments
 (0)