Bläddra i källkod

Pep8 corrections

Some minor adjustments
Jeroen 12 år sedan
förälder
incheckning
a4f99ed7d5
4 ändrade filer med 8 tillägg och 4 borttagningar
  1. 4 3
      3-tier.py
  2. BIN
      __pycache__/mediator.cpython-33.pyc
  3. 1 1
      chain.py
  4. 3 0
      decorator.py

+ 4 - 3
3-tier.py

@@ -39,10 +39,11 @@ class Ui(object):
         if product_info:
             print('PRODUCT INFORMATION:')
             print('Name: {0}, Price: {1:.2f}, Quantity: {2:}'.format(
-                   product.title(), product_info.get('price', 0),
-                   product_info.get('quantity', 0)))
+                product.title(), product_info.get('price', 0),
+                product_info.get('quantity', 0)))
         else:
-            print('That product "{0}" does not exist in the records'.format(product))
+            print('That product "{0}" does not exist in the records'.format(
+                product))
 
 
 def main():

BIN
__pycache__/mediator.cpython-33.pyc


+ 1 - 1
chain.py

@@ -39,7 +39,7 @@ class Client:
         h1.successor(h2)
         h2.successor(h3)
 
-        self.handlers = (h1,h2,h3)
+        self.handlers = (h1, h2, h3)
 
     def delegate(self, requests):
         for request in requests:

+ 3 - 0
decorator.py

@@ -1,5 +1,6 @@
 # http://stackoverflow.com/questions/3118929/implementing-the-decorator-pattern-in-python
 
+
 class foo_decorator(object):
     def __init__(self, decoratee):
         self._decoratee = decoratee
@@ -11,6 +12,7 @@ class foo_decorator(object):
     def __getattr__(self, name):
         return getattr(self._decoratee, name)
 
+
 class undecorated_foo(object):
     def f1(self):
         print("original f1")
@@ -18,6 +20,7 @@ class undecorated_foo(object):
     def f2(self):
         print("original f2")
 
+
 @foo_decorator
 class decorated_foo(object):
     def f1(self):