Skip to content

Commit 447a182

Browse files
committed
🎨 style: format code with Ruff (imports and whitespace cleanup)
1 parent 9f1522a commit 447a182

40 files changed

+101
-111
lines changed

pythonie/core/factories.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import factory
2-
from factory.django import DjangoModelFactory
32
from django.utils import timezone
4-
5-
from core.models import HomePage, SimplePage
3+
from factory.django import DjangoModelFactory
64
from meetups.models import Meetup
75
from sponsors.models import SponsorshipLevel
86

7+
from core.models import HomePage, SimplePage
8+
99

1010
class SponsorshipLevelFactory(DjangoModelFactory):
1111
class Meta:

pythonie/core/management/commands/generate_sample_data.py

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from django.core.management.base import BaseCommand
22
from wagtail.models import Page, Site
33

4-
from core.factories import SponsorshipLevelFactory, MeetupFactory, HomePageFactory, SimplePageFactory
4+
from core.factories import (
5+
HomePageFactory,
6+
MeetupFactory,
7+
SimplePageFactory,
8+
SponsorshipLevelFactory,
9+
)
510
from core.models import HomePage, SimplePage
611

712

@@ -84,45 +89,62 @@ def _create_page(self, parent, title, slug, body=None):
8489
self.stdout.write(f" {title} already exists")
8590
return SimplePage.objects.get(slug=slug)
8691

87-
page = SimplePageFactory.build(title=title, slug=slug, body=body or [], show_in_menus=True)
92+
page = SimplePageFactory.build(
93+
title=title, slug=slug, body=body or [], show_in_menus=True
94+
)
8895
parent.add_child(instance=page)
8996
self.stdout.write(self.style.SUCCESS(f"Created {title}"))
9097
return page
9198

9299
def _get_home_content(self):
93100
return [
94101
{"type": "heading", "value": "Introduction"},
95-
{"type": "paragraph", "value": (
96-
"<p>Python Ireland is the Irish organisation representing the various chapters of Python users. "
97-
"We organise meet ups and events for software developers, students, academics and anyone who wants "
98-
"to learn the language. One of our aims is to help grow and diversify the Python community in Ireland. "
99-
"We also develop and foster links with other Python based communities overseas.</p>"
100-
)},
102+
{
103+
"type": "paragraph",
104+
"value": (
105+
"<p>Python Ireland is the Irish organisation representing the various chapters of Python users. "
106+
"We organise meet ups and events for software developers, students, academics and anyone who wants "
107+
"to learn the language. One of our aims is to help grow and diversify the Python community in Ireland. "
108+
"We also develop and foster links with other Python based communities overseas.</p>"
109+
),
110+
},
101111
{"type": "heading", "value": "PyCon Ireland 2025"},
102-
{"type": "paragraph", "value": (
103-
"<p>We are thrilled to announce PyCon Ireland 2025, taking place in Dublin "
104-
"on November 15th and 16th! Join us at the UCD O'Reilly Hall for this exciting event.</p>"
105-
)},
106-
{"type": "paragraph", "value": (
107-
"<p>PyCon Ireland 2025 will feature two talk tracks and two workshop tracks on both days. "
108-
"Your ticket includes breakfast and lunch. Join us Saturday evening for networking!</p>"
109-
)},
110-
{"type": "paragraph", "value": (
111-
"<p>Please adhere to our <a href='/policies/code-of-conduct/'>Code of Conduct</a>. "
112-
"Check <a href='/pycon-2025/'>Terms and conditions</a> for details.</p>"
113-
)},
112+
{
113+
"type": "paragraph",
114+
"value": (
115+
"<p>We are thrilled to announce PyCon Ireland 2025, taking place in Dublin "
116+
"on November 15th and 16th! Join us at the UCD O'Reilly Hall for this exciting event.</p>"
117+
),
118+
},
119+
{
120+
"type": "paragraph",
121+
"value": (
122+
"<p>PyCon Ireland 2025 will feature two talk tracks and two workshop tracks on both days. "
123+
"Your ticket includes breakfast and lunch. Join us Saturday evening for networking!</p>"
124+
),
125+
},
126+
{
127+
"type": "paragraph",
128+
"value": (
129+
"<p>Please adhere to our <a href='/policies/code-of-conduct/'>Code of Conduct</a>. "
130+
"Check <a href='/pycon-2025/'>Terms and conditions</a> for details.</p>"
131+
),
132+
},
114133
{"type": "paragraph", "value": "<p>See you at PyCon Ireland 2025!</p>"},
115134
]
116135

117136
def _get_meetups_content(self):
118137
return [
119138
{"type": "heading", "value": "Python Ireland Meetups"},
120-
{"type": "paragraph", "value": (
121-
"<p>Join us at our regular meetups! We hold events every month.</p>"
122-
"<ul>"
123-
"<li><a href='https://www.meetup.com/pythonireland/events/'>Upcoming Events</a></li>"
124-
"<li><a href='https://www.meetup.com/pythonireland/photos/'>Photos</a></li>"
125-
"<li><a href='https://www.meetup.com/pythonireland/'>Python Ireland on Meetup.com</a></li>"
126-
"</ul>"
127-
)},
139+
{
140+
"type": "paragraph",
141+
"value": (
142+
"<p>Join us at our regular meetups! We hold events every month.</p>"
143+
"<ul>"
144+
"<li><a href='https://www.meetup.com/pythonireland/events/'>Upcoming Events</a></li>"
145+
"<li><a href='https://www.meetup.com/pythonireland/photos/'>Photos</a></li>"
146+
"<li><a href='https://www.meetup.com/pythonireland/'>Python Ireland on Meetup.com</a></li>"
147+
"</ul>"
148+
),
149+
},
128150
]

pythonie/core/migrations/0001_initial.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
import django.utils.timezone
54
import modelcluster.fields
65
import wagtail.fields
76
from django.db import migrations, models
87

98

109
class Migration(migrations.Migration):
11-
1210
dependencies = [
1311
("wagtailcore", "0013_update_golive_expire_help_text"),
1412
]

pythonie/core/migrations/0002_simplepage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class Migration(migrations.Migration):
11-
1211
dependencies = [
1312
("core", "0001_initial"),
1413
]

pythonie/core/migrations/0003_media_in_simple_page.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
from __future__ import unicode_literals
33

44
import wagtail.blocks
5-
import wagtail.fields
65
import wagtail.embeds.blocks
6+
import wagtail.fields
77
import wagtail.images.blocks
8-
from django.db import migrations, models
8+
from django.db import migrations
99

1010

1111
class Migration(migrations.Migration):
12-
1312
dependencies = [
1413
("core", "0002_simplepage"),
1514
]
@@ -22,9 +21,7 @@ class Migration(migrations.Migration):
2221
(
2322
(
2423
"heading",
25-
wagtail.blocks.CharBlock(
26-
classname="full title", icon="home"
27-
),
24+
wagtail.blocks.CharBlock(classname="full title", icon="home"),
2825
),
2926
("paragraph", wagtail.blocks.RichTextBlock(icon="edit")),
3027
("video", wagtail.embeds.blocks.EmbedBlock(icon="media")),

pythonie/core/migrations/0004_auto_20150708_1416.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
from __future__ import unicode_literals
33

44
import wagtail.blocks
5-
import wagtail.fields
65
import wagtail.embeds.blocks
6+
import wagtail.fields
77
import wagtail.images.blocks
88
from django.db import migrations, models
99

1010

1111
class Migration(migrations.Migration):
12-
1312
dependencies = [
1413
("core", "0003_media_in_simple_page"),
1514
]
@@ -22,9 +21,7 @@ class Migration(migrations.Migration):
2221
(
2322
(
2423
"heading",
25-
wagtail.blocks.CharBlock(
26-
icon="home", classname="full title"
27-
),
24+
wagtail.blocks.CharBlock(icon="home", classname="full title"),
2825
),
2926
("paragraph", wagtail.blocks.RichTextBlock(icon="edit")),
3027
("video", wagtail.embeds.blocks.EmbedBlock(icon="media")),

pythonie/core/migrations/0005_auto_20150726_1416.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("core", "0004_auto_20150708_1416"),
1110
]

pythonie/core/migrations/0006_homepagesponsorrelationship.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("sponsors", "0004_auto_20150726_1412"),
1110
("core", "0005_auto_20150726_1416"),

pythonie/core/migrations/0007_homepage_sponsors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("sponsors", "0004_auto_20150726_1412"),
1110
("core", "0006_homepagesponsorrelationship"),

pythonie/core/migrations/0008_auto_20150821_2230.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
from __future__ import unicode_literals
33

44
import wagtail.blocks
5-
import wagtail.fields
65
import wagtail.embeds.blocks
6+
import wagtail.fields
77
import wagtail.images.blocks
8-
from django.db import migrations, models
8+
from django.db import migrations
99

1010

1111
class Migration(migrations.Migration):
12-
1312
dependencies = [
1413
("core", "0007_homepage_sponsors"),
1514
]
@@ -22,9 +21,7 @@ class Migration(migrations.Migration):
2221
(
2322
(
2423
"heading",
25-
wagtail.blocks.CharBlock(
26-
icon="home", classname="full title"
27-
),
24+
wagtail.blocks.CharBlock(icon="home", classname="full title"),
2825
),
2926
("paragraph", wagtail.blocks.RichTextBlock(icon="edit")),
3027
("video", wagtail.embeds.blocks.EmbedBlock(icon="media")),
@@ -42,9 +39,7 @@ class Migration(migrations.Migration):
4239
(
4340
(
4441
"heading",
45-
wagtail.blocks.CharBlock(
46-
icon="home", classname="full title"
47-
),
42+
wagtail.blocks.CharBlock(icon="home", classname="full title"),
4843
),
4944
("paragraph", wagtail.blocks.RichTextBlock(icon="edit")),
5045
("video", wagtail.embeds.blocks.EmbedBlock(icon="media")),

0 commit comments

Comments
 (0)