ran code reformat
This commit is contained in:
@@ -12,6 +12,7 @@ class ChainLink(object, metaclass=ABCMeta):
|
||||
"""
|
||||
Abstract ChainLink object as part of the Chain of Responsibility pattern.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Initialize a new ChainLink instance.
|
||||
@@ -52,6 +53,7 @@ class Chain(object, metaclass=ABCMeta):
|
||||
"""
|
||||
Abstract Chain class as part of the Chain of Responsibility pattern.
|
||||
"""
|
||||
|
||||
def __init__(self, chainlink):
|
||||
"""
|
||||
Initialize a new Chain instance.
|
||||
@@ -76,4 +78,4 @@ class Chain(object, metaclass=ABCMeta):
|
||||
"""
|
||||
The method to call when the chain could not handle a request.
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -12,12 +12,14 @@ class InvalidInvokerCommandException(Exception):
|
||||
"""
|
||||
Exception for when an invalid command is given to an Invoker to execute.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Receiver(object, metaclass=ABCMeta):
|
||||
"""
|
||||
Abstract receiver class as part of the Command pattern.
|
||||
"""
|
||||
|
||||
def action(self, name, *args, **kwargs):
|
||||
"""
|
||||
Delegates which method to be called for a desired action.
|
||||
@@ -37,6 +39,7 @@ class Command(object, metaclass=ABCMeta):
|
||||
"""
|
||||
Abstract Command class as part of the Command pattern.
|
||||
"""
|
||||
|
||||
def __init__(self, receiver):
|
||||
"""
|
||||
Initialize a new command instance.
|
||||
@@ -65,6 +68,7 @@ class Invoker(object, metaclass=ABCMeta):
|
||||
"""
|
||||
Abstract Invoker class as part of the Command pattern.
|
||||
"""
|
||||
|
||||
def __init__(self, valid_commands):
|
||||
"""
|
||||
Initialize a new Invoker instance.
|
||||
|
||||
@@ -7,6 +7,7 @@ class Director(object, metaclass=ABCMeta):
|
||||
|
||||
Part of the builder pattern.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Initialize a new Director.
|
||||
@@ -39,6 +40,7 @@ class Builder(object):
|
||||
|
||||
Part of the builder pattern.
|
||||
"""
|
||||
|
||||
def __init__(self, constructed_object):
|
||||
"""
|
||||
Initialize a new Builder.
|
||||
|
||||
@@ -7,6 +7,7 @@ class Factory(object, metaclass=ABCMeta):
|
||||
|
||||
All Factories should inherit this class and overwrite the create method.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def create(self, **kwargs):
|
||||
"""
|
||||
@@ -23,6 +24,7 @@ class AbstractFactory(object):
|
||||
"""
|
||||
Abstract Factory Class.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Initialize the abstract factory.
|
||||
|
||||
@@ -6,6 +6,7 @@ class Reusable(object):
|
||||
"""
|
||||
An abstract reusable class.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Initialize a new Reusable instance.
|
||||
@@ -24,6 +25,7 @@ class Pool(object, metaclass=Singleton):
|
||||
"""
|
||||
An Object Pool design pattern implementation.
|
||||
"""
|
||||
|
||||
def __init__(self, reusable_class, *args, **kwargs):
|
||||
"""
|
||||
Initialize a new object pool instance.
|
||||
|
||||
@@ -6,6 +6,7 @@ class Prototype(object):
|
||||
"""
|
||||
Prototype design pattern abstract class.
|
||||
"""
|
||||
|
||||
def copy(self, **attributes):
|
||||
"""
|
||||
Copy this object and optionally update attributes.
|
||||
@@ -21,6 +22,3 @@ class Prototype(object):
|
||||
setattr(obj, attribute, attributes[attribute])
|
||||
|
||||
return obj
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user