Skip to content

Commit

Permalink
Apply ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Nov 21, 2023
1 parent 10683e1 commit fd6b19d
Show file tree
Hide file tree
Showing 61 changed files with 0 additions and 108 deletions.
2 changes: 0 additions & 2 deletions stringprint2/charts/chart_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@


class ChartType(SerialBase):

registered = {}

def __init__(
self, chart_type, code_template, package_name="corechart", options=None
):

self.chart_type = chart_type
self.package_name = package_name
self.code_template = code_template
Expand Down
2 changes: 0 additions & 2 deletions stringprint2/charts/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class ChartCollection(object):
"""

def __init__(self, charts: List[Any]) -> None:

if RENDER_TABLES_AS_CHARTS is False:
charts = [x for x in charts if x.chart_type != "table_chart"]
self.charts = charts
Expand Down Expand Up @@ -110,7 +109,6 @@ class Chart(SerialObject):
"""

def __init__(self, name="", file_name="", chart_type="line_chart"):

self.chart_type = chart_type
self.name = name
self.filename = file_name
Expand Down
5 changes: 0 additions & 5 deletions stringprint2/frontend/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def render(self, name, value, attrs=None):


class PageHeaderImageForm(forms.ModelForm):

image = forms.ImageField(label="Image", widget=AdminImageWidget, required=False)
image_vertical = forms.ImageField(
label="Responsive Image",
Expand Down Expand Up @@ -85,7 +84,6 @@ class Meta:


class ArticlePublishForm(forms.Form):

publish_url = forms.CharField(
label="Final URL",
help_text="Where will this document be visible on the web? (used for social sharing).",
Expand Down Expand Up @@ -181,7 +179,6 @@ def validate_file_extension(value):


class ReuploadWordForm(HoneyPotForm):

file = forms.FileField(
label="Upload a Word file (optional)",
required=False,
Expand All @@ -190,7 +187,6 @@ class ReuploadWordForm(HoneyPotForm):


class NewDocumentForm(HoneyPotForm):

title = forms.CharField(
label="Document Title", help_text="Don't worry, this can be changed later."
)
Expand Down Expand Up @@ -223,5 +219,4 @@ def is_valid(self):
else:
return True
else:

return False
1 change: 0 additions & 1 deletion stringprint2/frontend/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("stringprint", "0012_auto_20160822_1553"),
Expand Down
1 change: 0 additions & 1 deletion stringprint2/frontend/migrations/0002_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0013_auto_20160829_1340"),
("frontend", "0001_initial"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("frontend", "0002_download"),
]
Expand Down
1 change: 0 additions & 1 deletion stringprint2/frontend/migrations/0004_tokensetting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("frontend", "0003_usersettings_tokens"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("frontend", "0004_tokensetting"),
]
Expand Down
10 changes: 0 additions & 10 deletions stringprint2/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ class ArticleHeadersView(ArticleEditBase, LoggedInView):
url_name = "article.headers"

def logic(self):

header = self.article.images.filter(title_image=True)
if header.exists():
instance = header[0]
Expand Down Expand Up @@ -241,14 +240,12 @@ def logic(self):


class ArticleSettingsView(ArticleEditBase, LoggedInView):

template = "frontend//document_settings.html"
url_patterns = [r"^document/([0-9]*)/settings/"]
url_name = "article.settings"
form = ff.ArticleEditForm

def logic(self):

if self.request.POST:
form = self.form(self.request.POST, instance=self.article)
if form.is_valid():
Expand Down Expand Up @@ -289,13 +286,11 @@ def logic(self):


class RegisterView(ComboView):

template = "registration//register.html"
url_patterns = [r"^register/"]
url_name = "register"

def view(self, request):

if request.POST:
form = ff.RegisterForm(request.POST)
if form.is_valid():
Expand Down Expand Up @@ -324,7 +319,6 @@ def view(self, request):


class NewDocView(LoggedInView):

template = "frontend//new_doc.html"
url_patterns = [r"^document/new"]
url_name = "document.new"
Expand Down Expand Up @@ -377,7 +371,6 @@ def short_title(v):


class ReuploadFormView(ArticleEditBase, LoggedInView):

template = "frontend//doc_reupload.html"
url_patterns = [r"^document/([0-9]*)/reupload"]
url_name = "document.reupload"
Expand Down Expand Up @@ -407,7 +400,6 @@ def new_doc_form_logic(self):


class ChangeOrgView(NewDocView):

url_patterns = [r"^orgs/change/(.*)"]
url_name = "org.change"
args = ("org_id",)
Expand All @@ -419,7 +411,6 @@ def logic(self):


class HomeView(NewDocView):

template = "frontend//home.html"
url_patterns = [r"^"]
url_name = "home"
Expand All @@ -432,7 +423,6 @@ def logic(self):


class DocListView(HomeView):

template = "frontend//doc_list.html"
url_patterns = [r"^documents/list", r"^documents/list/(.*)"]
url_name = "document.list"
Expand Down
1 change: 0 additions & 1 deletion stringprint2/proj/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

if DEBUG:

CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
Expand Down
1 change: 0 additions & 1 deletion stringprint2/stringprint/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0001_initial"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0002_headerimage_image_vertical"),
]
Expand Down
1 change: 0 additions & 1 deletion stringprint2/stringprint/migrations/0004_article_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0003_access_password"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0004_article_public"),
]
Expand Down
1 change: 0 additions & 1 deletion stringprint2/stringprint/migrations/0006_asset_alt_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0005_auto_20160802_1028"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0006_asset_alt_text"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0007_asset_image_chart"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0008_auto_20160804_1141"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0009_auto_20160804_1154"),
]
Expand Down
1 change: 0 additions & 1 deletion stringprint2/stringprint/migrations/0011_asset_caption.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0010_article_first_section_name"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0011_asset_caption"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0012_auto_20160822_1553"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0013_auto_20160829_1340"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0014_auto_20160829_1424"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0015_organisation_publish_root"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0016_auto_20160830_1419"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0017_article_publish_tokens"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0018_auto_20160831_0903"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0019_article_pdf_location"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0020_auto_20170727_1133"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0021_article_display_footnotes_at_foot"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0022_auto_20180615_1527"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0023_auto_20180707_1114"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("stringprint", "0024_auto_20190322_1324"),
]
Expand Down
Loading

0 comments on commit fd6b19d

Please sign in to comment.