8000 black · realpython/materials@ca54f59 · GitHub
[go: up one dir, main page]

Skip to content

Commit ca54f59

Browse files
committed
black
1 parent e5fb093 commit ca54f59

File tree

26 files changed

+67
-49
lines changed

26 files changed

+67
-49
lines changed

python-circular-import/layered-architecture/shop/__main__.py

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

33
if __name__ == "__main__":
44
controller = ShopController()
5-
controller.handle_request()
5+
controller.handle_request()

python-circular-import/layered-architecture/shop/controllers/shop_controller.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ class ShopController:
66

77
def __new__(cls, *args, **kwargs):
88
if not cls._instance:
9-
cls._instance = super(ShopController, cls).__new__(cls, *args, **kwargs)
9+
cls._instance = super(ShopController, cls).__new__(
10+
cls, *args, **kwargs
11+
)
1012
return cls._instance
1113

1214
def __init__(self):
13-
if not hasattr(self, 'service'):
15+
if not hasattr(self, "service"):
1416
self.service = ShopService()
1517

1618
def handle_request(self):
1719
print("Handling request")
18-
self.service.perform_service_task()
20+
self.service.perform_service_task()

python-circular-import/layered-architecture/shop/services/shop_service.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ class ShopService:
66

77
def __new__(cls, *args, **kwargs):
88
if not cls._instance:
9-
cls._instance = super(ShopService, cls).__new__(cls, *args, **kwargs)
9+
cls._instance = super(ShopService, cls).__new__(
10+
cls, *args, **kwargs
11+
)
1012
return cls._instance
1113

1214
def __init__(self):
13-
if not hasattr(self, 'controller'):
15+
if not hasattr(self, "controller"):
1416
self.controller = ShopController()
1517

1618
def perform_service_task(self):
1719
print("Service task performed")
18-
self.controller.handle_request()
20+
self.controller.handle_request()

python-circular-import/layered-architecture/shop_di/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
if __name__ == "__main__":
55
service = ShopService()
66
controller = ShopController(service)
7-
controller.handle_request()
7+
controller.handle_request()

python-circular-import/layered-architecture/shop_di/controllers/shop_controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def __new__(cls, *args, **kwargs):
77
return cls._instance
88

99
def __init__(self, service):
10-
if not hasattr(self, 'service'):
10+
if not hasattr(self, "service"):
1111
self.service = service
1212

1313
def handle_request(self):
1414
print("Handling request")
15-
self.service.perform_service_task()
15+
self.service.perform_service_task()

python-circular-import/layered-architecture/shop_di/services/shop_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ def __init__(self):
1010
pass
1111

1212
def perform_service_task(self):
13-
print("Service task performed")
13+
print("Service task performed")

python-circular-import/layered-architecture/shop_import_recursion/__main__.py

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

33
if __name__ == "__main__":
44
controller = ShopController()
5-
controller.handle_request()
5+
controller.handle_request()

python-circular-import/layered-architecture/shop_import_recursion/controllers/shop_controller.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@ class ShopController:
77

88
def __new__(cls, *args, **kwargs):
99
if not cls._instance:
10-
cls._instance = super(ShopController, cls).__new__(cls, *args, **kwargs)
10+
cls._instance = super(ShopController, cls).__new__(
11+
cls, *args, **kwargs
12+
)
1113
return cls._instance
1214

1315
def __init__(self):
14-
if not hasattr(self, 'service'):
16+
if not hasattr(self, "service"):
1517
# self.service = shop_service.ShopService()
1618
print(dir(shop_import_recursion))
17-
self.service = shop_import_recursion.services.shop_service.ShopService()
19+
self.service = (
20+
shop_import_recursion.services.shop_service.ShopService()
21+
)
1822

1923
def handle_request(self):
2024
print("Handling request")
21-
self.service.perform_service_task()
25+
self.service.perform_service_task()

python-circular-import/layered-architecture/shop_import_recursion/services/shop_service.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ class ShopService:
77

88
def __new__(cls, *args, **kwargs):
99
if not cls._instance:
10-
cls._instance = super(ShopService, cls).__new__(cls, *args, **kwargs)
10+
cls._instance = super(ShopService, cls).__new__(
11+
cls, *args, **kwargs
12+
)
1113
return cls._instance
1214

1315
def __init__(self):
14-
if not hasattr(self, 'controller'):
16+
if not hasattr(self, "controller"):
1517
# self.controller = shop_controller.ShopController()
16-
self.controller = shop_import_recursion.controllers.shop_controller.ShopController()
18+
self.controller = (
19+
shop_import_recursion.controllers.shop_controller.ShopController()
20+
)
1721

1822
def perform_service_task(self):
1923
print("Service task performed")
20-
self.controller.handle_request()
24+
self.controller.handle_request()

python-circular-import/state-machine/state_machine/__main__.py

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

33
if __name__ == "__main__":
44
current_state = StateA()
5-
current_state = current_state.on_event('to_b')
5+
current_state = current_state.on_event("to_b")

0 commit comments

Comments
 (0)
0