Skip to content

Commit c0677d7

Browse files
committedMay 31, 2021
Formatted with black
1 parent b8849c1 commit c0677d7

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed
 

‎patterns/behavioral/strategy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class DiscountStrategyValidator: # Descriptor class for check perform
1818
def validate(obj: Order, value: Callable) -> bool:
1919
try:
2020
if obj.price - value(obj) < 0:
21-
raise ValueError(f"Discount cannot be applied due to negative price resulting. {value.__name__}")
21+
raise ValueError(
22+
f"Discount cannot be applied due to negative price resulting. {value.__name__}"
23+
)
2224
except ValueError as ex:
2325
print(str(ex))
2426
return False

‎patterns/structural/3-tier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Data:
10-
""" Data Store Class """
10+
"""Data Store Class"""
1111

1212
products = {
1313
"milk": {"price": 1.50, "quantity": 10},
@@ -22,7 +22,7 @@ def __get__(self, obj, klas):
2222

2323

2424
class BusinessLogic:
25-
""" Business logic holding data store instances """
25+
"""Business logic holding data store instances"""
2626

2727
data = Data()
2828

@@ -36,7 +36,7 @@ def product_information(
3636

3737

3838
class Ui:
39-
""" UI interaction class """
39+
"""UI interaction class"""
4040

4141
def __init__(self) -> None:
4242
self.business_logic = BusinessLogic()

‎patterns/structural/front_controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def dispatch(self, request):
3131

3232

3333
class RequestController:
34-
""" front controller """
34+
"""front controller"""
3535

3636
def __init__(self):
3737
self.dispatcher = Dispatcher()
@@ -44,7 +44,7 @@ def dispatch_request(self, request):
4444

4545

4646
class Request:
47-
""" request """
47+
"""request"""
4848

4949
mobile_type = "mobile"
5050
tablet_type = "tablet"

0 commit comments

Comments
 (0)
Please sign in to comment.