From 585ae7e016f5adcff41fe3da0cf28544dcd9507f Mon Sep 17 00:00:00 2001 From: tylerlaberge Date: Sat, 10 Sep 2016 17:32:55 -0400 Subject: [PATCH] added api html files --- .gitattributes | 1 + .gitignore | 1 - html/api-objects.txt | 142 ++++ html/class-tree.html | 154 +++++ html/crarr.png | Bin 0 -> 340 bytes html/epydoc.css | 322 +++++++++ html/epydoc.js | 293 ++++++++ html/frames.html | 17 + html/help.html | 268 ++++++++ html/identifier-index.html | 638 ++++++++++++++++++ html/index.html | 17 + html/module-tree.html | 137 ++++ html/pypat-module.html | 180 +++++ html/pypat-pysrc.html | 111 +++ html/pypat.behavioral-module.html | 160 +++++ html/pypat.behavioral-pysrc.html | 112 +++ html/pypat.behavioral.chain-module.html | 139 ++++ html/pypat.behavioral.chain-pysrc.html | 189 ++++++ html/pypat.behavioral.chain.Chain-class.html | 277 ++++++++ ...ypat.behavioral.chain.ChainLink-class.html | 299 ++++++++ html/pypat.behavioral.command-module.html | 147 ++++ html/pypat.behavioral.command-pysrc.html | 203 ++++++ ...ypat.behavioral.command.Command-class.html | 275 ++++++++ ...ypat.behavioral.command.Invoker-class.html | 254 +++++++ ...pat.behavioral.command.Receiver-class.html | 200 ++++++ html/pypat.behavioral.iterator-module.html | 139 ++++ html/pypat.behavioral.iterator-pysrc.html | 152 +++++ ...at.behavioral.iterator.Iterable-class.html | 194 ++++++ ...at.behavioral.iterator.Iterator-class.html | 280 ++++++++ html/pypat.behavioral.mediator-module.html | 156 +++++ html/pypat.behavioral.mediator-pysrc.html | 162 +++++ ...at.behavioral.mediator.Mediator-class.html | 380 +++++++++++ html/pypat.behavioral.memento-module.html | 164 +++++ html/pypat.behavioral.memento-pysrc.html | 159 +++++ ...ypat.behavioral.memento.Memento-class.html | 288 ++++++++ ...t.behavioral.memento.Originator-class.html | 283 ++++++++ html/pypat.behavioral.null-module.html | 156 +++++ html/pypat.behavioral.null-pysrc.html | 187 +++++ html/pypat.behavioral.null.Null-class.html | 536 +++++++++++++++ html/pypat.behavioral.observer-module.html | 139 ++++ html/pypat.behavioral.observer-pysrc.html | 171 +++++ ....behavioral.observer.Observable-class.html | 343 ++++++++++ ...at.behavioral.observer.Observer-class.html | 194 ++++++ html/pypat.behavioral.visitor-module.html | 139 ++++ html/pypat.behavioral.visitor-pysrc.html | 170 +++++ ...ypat.behavioral.visitor.Visitee-class.html | 251 +++++++ ...ypat.behavioral.visitor.Visitor-class.html | 255 +++++++ html/pypat.creational-module.html | 157 +++++ html/pypat.creational-pysrc.html | 112 +++ html/pypat.creational.builder-module.html | 139 ++++ html/pypat.creational.builder-pysrc.html | 191 ++++++ ...ypat.creational.builder.Builder-class.html | 291 ++++++++ ...pat.creational.builder.Director-class.html | 253 +++++++ html/pypat.creational.factory-module.html | 139 ++++ html/pypat.creational.factory-pysrc.html | 172 +++++ ...ational.factory.AbstractFactory-class.html | 285 ++++++++ ...ypat.creational.factory.Factory-class.html | 204 ++++++ html/pypat.creational.pool-module.html | 139 ++++ html/pypat.creational.pool-pysrc.html | 187 +++++ html/pypat.creational.pool.Pool-class.html | 351 ++++++++++ .../pypat.creational.pool.Reusable-class.html | 167 +++++ html/pypat.creational.prototype-module.html | 156 +++++ html/pypat.creational.prototype-pysrc.html | 138 ++++ ....creational.prototype.Prototype-class.html | 247 +++++++ html/pypat.creational.singleton-module.html | 156 +++++ html/pypat.creational.singleton-pysrc.html | 136 ++++ ....creational.singleton.Singleton-class.html | 302 +++++++++ html/pypat.structural-module.html | 156 +++++ html/pypat.structural-pysrc.html | 112 +++ html/pypat.structural.adapter-module.html | 156 +++++ html/pypat.structural.adapter-pysrc.html | 145 ++++ ...ypat.structural.adapter.Adapter-class.html | 311 +++++++++ html/pypat.structural.composite-module.html | 156 +++++ html/pypat.structural.composite-pysrc.html | 185 +++++ ....structural.composite.Composite-class.html | 430 ++++++++++++ html/pypat.structural.decorator-module.html | 155 +++++ html/pypat.structural.decorator-pysrc.html | 203 ++++++ ...tructural.decorator.CallWrapper-class.html | 166 +++++ ....structural.decorator.Decorator-class.html | 217 ++++++ ...ural.decorator.DecoratorComplex-class.html | 257 +++++++ ...tural.decorator.DecoratorSimple-class.html | 195 ++++++ html/pypat.structural.flyweight-module.html | 156 +++++ html/pypat.structural.flyweight-pysrc.html | 165 +++++ ...uctural.flyweight.FlyweightMeta-class.html | 373 ++++++++++ html/redirect.html | 38 ++ html/toc-everything.html | 73 ++ html/toc-pypat-module.html | 31 + html/toc-pypat.behavioral-module.html | 31 + html/toc-pypat.behavioral.chain-module.html | 32 + html/toc-pypat.behavioral.command-module.html | 33 + .../toc-pypat.behavioral.iterator-module.html | 32 + .../toc-pypat.behavioral.mediator-module.html | 33 + html/toc-pypat.behavioral.memento-module.html | 34 + html/toc-pypat.behavioral.null-module.html | 33 + .../toc-pypat.behavioral.observer-module.html | 32 + html/toc-pypat.behavioral.visitor-module.html | 32 + html/toc-pypat.creational-module.html | 31 + html/toc-pypat.creational.builder-module.html | 32 + html/toc-pypat.creational.factory-module.html | 32 + html/toc-pypat.creational.pool-module.html | 32 + ...toc-pypat.creational.prototype-module.html | 33 + ...toc-pypat.creational.singleton-module.html | 33 + html/toc-pypat.structural-module.html | 31 + html/toc-pypat.structural.adapter-module.html | 33 + ...toc-pypat.structural.composite-module.html | 33 + ...toc-pypat.structural.decorator-module.html | 34 + ...toc-pypat.structural.flyweight-module.html | 33 + html/toc.html | 53 ++ 108 files changed, 17737 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 html/api-objects.txt create mode 100644 html/class-tree.html create mode 100644 html/crarr.png create mode 100644 html/epydoc.css create mode 100644 html/epydoc.js create mode 100644 html/frames.html create mode 100644 html/help.html create mode 100644 html/identifier-index.html create mode 100644 html/index.html create mode 100644 html/module-tree.html create mode 100644 html/pypat-module.html create mode 100644 html/pypat-pysrc.html create mode 100644 html/pypat.behavioral-module.html create mode 100644 html/pypat.behavioral-pysrc.html create mode 100644 html/pypat.behavioral.chain-module.html create mode 100644 html/pypat.behavioral.chain-pysrc.html create mode 100644 html/pypat.behavioral.chain.Chain-class.html create mode 100644 html/pypat.behavioral.chain.ChainLink-class.html create mode 100644 html/pypat.behavioral.command-module.html create mode 100644 html/pypat.behavioral.command-pysrc.html create mode 100644 html/pypat.behavioral.command.Command-class.html create mode 100644 html/pypat.behavioral.command.Invoker-class.html create mode 100644 html/pypat.behavioral.command.Receiver-class.html create mode 100644 html/pypat.behavioral.iterator-module.html create mode 100644 html/pypat.behavioral.iterator-pysrc.html create mode 100644 html/pypat.behavioral.iterator.Iterable-class.html create mode 100644 html/pypat.behavioral.iterator.Iterator-class.html create mode 100644 html/pypat.behavioral.mediator-module.html create mode 100644 html/pypat.behavioral.mediator-pysrc.html create mode 100644 html/pypat.behavioral.mediator.Mediator-class.html create mode 100644 html/pypat.behavioral.memento-module.html create mode 100644 html/pypat.behavioral.memento-pysrc.html create mode 100644 html/pypat.behavioral.memento.Memento-class.html create mode 100644 html/pypat.behavioral.memento.Originator-class.html create mode 100644 html/pypat.behavioral.null-module.html create mode 100644 html/pypat.behavioral.null-pysrc.html create mode 100644 html/pypat.behavioral.null.Null-class.html create mode 100644 html/pypat.behavioral.observer-module.html create mode 100644 html/pypat.behavioral.observer-pysrc.html create mode 100644 html/pypat.behavioral.observer.Observable-class.html create mode 100644 html/pypat.behavioral.observer.Observer-class.html create mode 100644 html/pypat.behavioral.visitor-module.html create mode 100644 html/pypat.behavioral.visitor-pysrc.html create mode 100644 html/pypat.behavioral.visitor.Visitee-class.html create mode 100644 html/pypat.behavioral.visitor.Visitor-class.html create mode 100644 html/pypat.creational-module.html create mode 100644 html/pypat.creational-pysrc.html create mode 100644 html/pypat.creational.builder-module.html create mode 100644 html/pypat.creational.builder-pysrc.html create mode 100644 html/pypat.creational.builder.Builder-class.html create mode 100644 html/pypat.creational.builder.Director-class.html create mode 100644 html/pypat.creational.factory-module.html create mode 100644 html/pypat.creational.factory-pysrc.html create mode 100644 html/pypat.creational.factory.AbstractFactory-class.html create mode 100644 html/pypat.creational.factory.Factory-class.html create mode 100644 html/pypat.creational.pool-module.html create mode 100644 html/pypat.creational.pool-pysrc.html create mode 100644 html/pypat.creational.pool.Pool-class.html create mode 100644 html/pypat.creational.pool.Reusable-class.html create mode 100644 html/pypat.creational.prototype-module.html create mode 100644 html/pypat.creational.prototype-pysrc.html create mode 100644 html/pypat.creational.prototype.Prototype-class.html create mode 100644 html/pypat.creational.singleton-module.html create mode 100644 html/pypat.creational.singleton-pysrc.html create mode 100644 html/pypat.creational.singleton.Singleton-class.html create mode 100644 html/pypat.structural-module.html create mode 100644 html/pypat.structural-pysrc.html create mode 100644 html/pypat.structural.adapter-module.html create mode 100644 html/pypat.structural.adapter-pysrc.html create mode 100644 html/pypat.structural.adapter.Adapter-class.html create mode 100644 html/pypat.structural.composite-module.html create mode 100644 html/pypat.structural.composite-pysrc.html create mode 100644 html/pypat.structural.composite.Composite-class.html create mode 100644 html/pypat.structural.decorator-module.html create mode 100644 html/pypat.structural.decorator-pysrc.html create mode 100644 html/pypat.structural.decorator.CallWrapper-class.html create mode 100644 html/pypat.structural.decorator.Decorator-class.html create mode 100644 html/pypat.structural.decorator.DecoratorComplex-class.html create mode 100644 html/pypat.structural.decorator.DecoratorSimple-class.html create mode 100644 html/pypat.structural.flyweight-module.html create mode 100644 html/pypat.structural.flyweight-pysrc.html create mode 100644 html/pypat.structural.flyweight.FlyweightMeta-class.html create mode 100644 html/redirect.html create mode 100644 html/toc-everything.html create mode 100644 html/toc-pypat-module.html create mode 100644 html/toc-pypat.behavioral-module.html create mode 100644 html/toc-pypat.behavioral.chain-module.html create mode 100644 html/toc-pypat.behavioral.command-module.html create mode 100644 html/toc-pypat.behavioral.iterator-module.html create mode 100644 html/toc-pypat.behavioral.mediator-module.html create mode 100644 html/toc-pypat.behavioral.memento-module.html create mode 100644 html/toc-pypat.behavioral.null-module.html create mode 100644 html/toc-pypat.behavioral.observer-module.html create mode 100644 html/toc-pypat.behavioral.visitor-module.html create mode 100644 html/toc-pypat.creational-module.html create mode 100644 html/toc-pypat.creational.builder-module.html create mode 100644 html/toc-pypat.creational.factory-module.html create mode 100644 html/toc-pypat.creational.pool-module.html create mode 100644 html/toc-pypat.creational.prototype-module.html create mode 100644 html/toc-pypat.creational.singleton-module.html create mode 100644 html/toc-pypat.structural-module.html create mode 100644 html/toc-pypat.structural.adapter-module.html create mode 100644 html/toc-pypat.structural.composite-module.html create mode 100644 html/toc-pypat.structural.decorator-module.html create mode 100644 html/toc-pypat.structural.flyweight-module.html create mode 100644 html/toc.html diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ba5e691 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/html/* linguist-vendored \ No newline at end of file diff --git a/.gitignore b/.gitignore index bee1c4f..04b4cca 100644 --- a/.gitignore +++ b/.gitignore @@ -90,4 +90,3 @@ ENV/ # Other .idea -html/ diff --git a/html/api-objects.txt b/html/api-objects.txt new file mode 100644 index 0000000..eb0bb85 --- /dev/null +++ b/html/api-objects.txt @@ -0,0 +1,142 @@ +pypat pypat-module.html +pypat.__package__ pypat-module.html#__package__ +pypat.behavioral pypat.behavioral-module.html +pypat.behavioral.__package__ pypat.behavioral-module.html#__package__ +pypat.behavioral.chain pypat.behavioral.chain-module.html +pypat.behavioral.command pypat.behavioral.command-module.html +pypat.behavioral.iterator pypat.behavioral.iterator-module.html +pypat.behavioral.mediator pypat.behavioral.mediator-module.html +pypat.behavioral.mediator.__package__ pypat.behavioral.mediator-module.html#__package__ +pypat.behavioral.memento pypat.behavioral.memento-module.html +pypat.behavioral.memento.__package__ pypat.behavioral.memento-module.html#__package__ +pypat.behavioral.null pypat.behavioral.null-module.html +pypat.behavioral.null.__package__ pypat.behavioral.null-module.html#__package__ +pypat.behavioral.observer pypat.behavioral.observer-module.html +pypat.behavioral.visitor pypat.behavioral.visitor-module.html +pypat.creational pypat.creational-module.html +pypat.creational.__package__ pypat.creational-module.html#__package__ +pypat.creational.builder pypat.creational.builder-module.html +pypat.creational.factory pypat.creational.factory-module.html +pypat.creational.pool pypat.creational.pool-module.html +pypat.creational.prototype pypat.creational.prototype-module.html +pypat.creational.prototype.__package__ pypat.creational.prototype-module.html#__package__ +pypat.creational.singleton pypat.creational.singleton-module.html +pypat.creational.singleton.__package__ pypat.creational.singleton-module.html#__package__ +pypat.structural pypat.structural-module.html +pypat.structural.__package__ pypat.structural-module.html#__package__ +pypat.structural.adapter pypat.structural.adapter-module.html +pypat.structural.adapter.__package__ pypat.structural.adapter-module.html#__package__ +pypat.structural.composite pypat.structural.composite-module.html +pypat.structural.composite.__package__ pypat.structural.composite-module.html#__package__ +pypat.structural.decorator pypat.structural.decorator-module.html +pypat.structural.flyweight pypat.structural.flyweight-module.html +pypat.structural.flyweight.__package__ pypat.structural.flyweight-module.html#__package__ +pypat.behavioral.chain.Chain pypat.behavioral.chain.Chain-class.html +pypat.behavioral.chain.Chain.fail pypat.behavioral.chain.Chain-class.html#fail +pypat.behavioral.chain.Chain.handle pypat.behavioral.chain.Chain-class.html#handle +pypat.behavioral.chain.Chain.__init__ pypat.behavioral.chain.Chain-class.html#__init__ +pypat.behavioral.chain.ChainLink pypat.behavioral.chain.ChainLink-class.html +pypat.behavioral.chain.ChainLink.set_successor pypat.behavioral.chain.ChainLink-class.html#set_successor +pypat.behavioral.chain.ChainLink.successor_handle pypat.behavioral.chain.ChainLink-class.html#successor_handle +pypat.behavioral.chain.ChainLink.handle pypat.behavioral.chain.ChainLink-class.html#handle +pypat.behavioral.chain.ChainLink.__init__ pypat.behavioral.chain.ChainLink-class.html#__init__ +pypat.behavioral.command.Command pypat.behavioral.command.Command-class.html +pypat.behavioral.command.Command.execute pypat.behavioral.command.Command-class.html#execute +pypat.behavioral.command.Command.unexecute pypat.behavioral.command.Command-class.html#unexecute +pypat.behavioral.command.Command.__init__ pypat.behavioral.command.Command-class.html#__init__ +pypat.behavioral.command.Invoker pypat.behavioral.command.Invoker-class.html +pypat.behavioral.command.Invoker.execute pypat.behavioral.command.Invoker-class.html#execute +pypat.behavioral.command.Invoker.undo pypat.behavioral.command.Invoker-class.html#undo +pypat.behavioral.command.Invoker.__init__ pypat.behavioral.command.Invoker-class.html#__init__ +pypat.behavioral.command.Receiver pypat.behavioral.command.Receiver-class.html +pypat.behavioral.command.Receiver.action pypat.behavioral.command.Receiver-class.html#action +pypat.behavioral.iterator.Iterable pypat.behavioral.iterator.Iterable-class.html +pypat.behavioral.iterator.Iterable.__next__ pypat.behavioral.iterator.Iterable-class.html#__next__ +pypat.behavioral.iterator.Iterator pypat.behavioral.iterator.Iterator-class.html +pypat.behavioral.iterator.Iterator.__next__ pypat.behavioral.iterator.Iterator-class.html#__next__ +pypat.behavioral.iterator.Iterator.__iter__ pypat.behavioral.iterator.Iterator-class.html#__iter__ +pypat.behavioral.iterator.Iterator.__init__ pypat.behavioral.iterator.Iterator-class.html#__init__ +pypat.behavioral.mediator.Mediator pypat.behavioral.mediator.Mediator-class.html +pypat.behavioral.mediator.Mediator.disconnect pypat.behavioral.mediator.Mediator-class.html#disconnect +pypat.behavioral.mediator.Mediator.signal pypat.behavioral.mediator.Mediator-class.html#signal +pypat.behavioral.mediator.Mediator.connect pypat.behavioral.mediator.Mediator-class.html#connect +pypat.behavioral.mediator.Mediator.__init__ pypat.behavioral.mediator.Mediator-class.html#__init__ +pypat.behavioral.memento.Memento pypat.behavioral.memento.Memento-class.html +pypat.behavioral.memento.Memento.state pypat.behavioral.memento.Memento-class.html#state +pypat.behavioral.memento.Memento.__init__ pypat.behavioral.memento.Memento-class.html#__init__ +pypat.behavioral.memento.Originator pypat.behavioral.memento.Originator-class.html +pypat.behavioral.memento.Originator.rollback pypat.behavioral.memento.Originator-class.html#rollback +pypat.behavioral.memento.Originator.commit pypat.behavioral.memento.Originator-class.html#commit +pypat.behavioral.null.Null pypat.behavioral.null.Null-class.html +pypat.behavioral.null.Null.__setattr__ pypat.behavioral.null.Null-class.html#__setattr__ +pypat.behavioral.null.Null.__str__ pypat.behavioral.null.Null-class.html#__str__ +pypat.behavioral.null.Null.__bool__ pypat.behavioral.null.Null-class.html#__bool__ +pypat.behavioral.null.Null.__getattr__ pypat.behavioral.null.Null-class.html#__getattr__ +pypat.behavioral.null.Null.__delattr__ pypat.behavioral.null.Null-class.html#__delattr__ +pypat.behavioral.null.Null.__repr__ pypat.behavioral.null.Null-class.html#__repr__ +pypat.behavioral.null.Null.__call__ pypat.behavioral.null.Null-class.html#__call__ +pypat.behavioral.null.Null.__init__ pypat.behavioral.null.Null-class.html#__init__ +pypat.behavioral.observer.Observable pypat.behavioral.observer.Observable-class.html +pypat.behavioral.observer.Observable.attach pypat.behavioral.observer.Observable-class.html#attach +pypat.behavioral.observer.Observable.notify pypat.behavioral.observer.Observable-class.html#notify +pypat.behavioral.observer.Observable.detach pypat.behavioral.observer.Observable-class.html#detach +pypat.behavioral.observer.Observable.__init__ pypat.behavioral.observer.Observable-class.html#__init__ +pypat.behavioral.observer.Observer pypat.behavioral.observer.Observer-class.html +pypat.behavioral.observer.Observer.update pypat.behavioral.observer.Observer-class.html#update +pypat.behavioral.visitor.Visitee pypat.behavioral.visitor.Visitee-class.html +pypat.behavioral.visitor.Visitee.accept pypat.behavioral.visitor.Visitee-class.html#accept +pypat.behavioral.visitor.Visitor pypat.behavioral.visitor.Visitor-class.html +pypat.behavioral.visitor.Visitor.generic_visit pypat.behavioral.visitor.Visitor-class.html#generic_visit +pypat.behavioral.visitor.Visitor.visit pypat.behavioral.visitor.Visitor-class.html#visit +pypat.creational.builder.Builder pypat.creational.builder.Builder-class.html +pypat.creational.builder.Builder._register pypat.creational.builder.Builder-class.html#_register +pypat.creational.builder.Builder.build pypat.creational.builder.Builder-class.html#build +pypat.creational.builder.Builder.__init__ pypat.creational.builder.Builder-class.html#__init__ +pypat.creational.builder.Director pypat.creational.builder.Director-class.html +pypat.creational.builder.Director.get_constructed_object pypat.creational.builder.Director-class.html#get_constructed_object +pypat.creational.builder.Director.construct pypat.creational.builder.Director-class.html#construct +pypat.creational.builder.Director.__init__ pypat.creational.builder.Director-class.html#__init__ +pypat.creational.factory.AbstractFactory pypat.creational.factory.AbstractFactory-class.html +pypat.creational.factory.AbstractFactory._register pypat.creational.factory.AbstractFactory-class.html#_register +pypat.creational.factory.AbstractFactory.create pypat.creational.factory.AbstractFactory-class.html#create +pypat.creational.factory.AbstractFactory.__init__ pypat.creational.factory.AbstractFactory-class.html#__init__ +pypat.creational.factory.Factory pypat.creational.factory.Factory-class.html +pypat.creational.factory.Factory.create pypat.creational.factory.Factory-class.html#create +pypat.creational.pool.Pool pypat.creational.pool.Pool-class.html +pypat.creational.pool.Pool._expand pypat.creational.pool.Pool-class.html#_expand +pypat.creational.pool.Pool.acquire pypat.creational.pool.Pool-class.html#acquire +pypat.creational.pool.Pool.release pypat.creational.pool.Pool-class.html#release +pypat.creational.pool.Pool.__init__ pypat.creational.pool.Pool-class.html#__init__ +pypat.creational.pool.Reusable pypat.creational.pool.Reusable-class.html +pypat.creational.pool.Reusable.reset pypat.creational.pool.Reusable-class.html#reset +pypat.creational.pool.Reusable.__init__ pypat.creational.pool.Reusable-class.html#__init__ +pypat.creational.prototype.Prototype pypat.creational.prototype.Prototype-class.html +pypat.creational.prototype.Prototype.prototype pypat.creational.prototype.Prototype-class.html#prototype +pypat.creational.singleton.Singleton pypat.creational.singleton.Singleton-class.html +pypat.creational.singleton.Singleton.__call__ pypat.creational.singleton.Singleton-class.html#__call__ +pypat.creational.singleton.Singleton.__instance pypat.creational.singleton.Singleton-class.html#__instance +pypat.structural.adapter.Adapter pypat.structural.adapter.Adapter-class.html +pypat.structural.adapter.Adapter.__getattr__ pypat.structural.adapter.Adapter-class.html#__getattr__ +pypat.structural.adapter.Adapter.original_dict pypat.structural.adapter.Adapter-class.html#original_dict +pypat.structural.adapter.Adapter.__init__ pypat.structural.adapter.Adapter-class.html#__init__ +pypat.structural.composite.Composite pypat.structural.composite.Composite-class.html +pypat.structural.composite.Composite.add_component pypat.structural.composite.Composite-class.html#add_component +pypat.structural.composite.Composite.__getattr__ pypat.structural.composite.Composite-class.html#__getattr__ +pypat.structural.composite.Composite._delegate pypat.structural.composite.Composite-class.html#_delegate +pypat.structural.composite.Composite.remove_component pypat.structural.composite.Composite-class.html#remove_component +pypat.structural.composite.Composite.__init__ pypat.structural.composite.Composite-class.html#__init__ +pypat.structural.decorator.CallWrapper pypat.structural.decorator.CallWrapper-class.html +pypat.structural.decorator.CallWrapper.__call__ pypat.structural.decorator.CallWrapper-class.html#__call__ +pypat.structural.decorator.DecoratorSimple.__init__ pypat.structural.decorator.DecoratorSimple-class.html#__init__ +pypat.structural.decorator.Decorator pypat.structural.decorator.Decorator-class.html +pypat.structural.decorator.Decorator.__call__ pypat.structural.decorator.Decorator-class.html#__call__ +pypat.structural.decorator.Decorator.__get__ pypat.structural.decorator.Decorator-class.html#__get__ +pypat.structural.decorator.DecoratorComplex pypat.structural.decorator.DecoratorComplex-class.html +pypat.structural.decorator.DecoratorComplex.__call__ pypat.structural.decorator.DecoratorComplex-class.html#__call__ +pypat.structural.decorator.DecoratorComplex.__init__ pypat.structural.decorator.DecoratorComplex-class.html#__init__ +pypat.structural.decorator.DecoratorSimple pypat.structural.decorator.DecoratorSimple-class.html +pypat.structural.decorator.DecoratorSimple.__init__ pypat.structural.decorator.DecoratorSimple-class.html#__init__ +pypat.structural.flyweight.FlyweightMeta pypat.structural.flyweight.FlyweightMeta-class.html +pypat.structural.flyweight.FlyweightMeta.__new__ pypat.structural.flyweight.FlyweightMeta-class.html#__new__ +pypat.structural.flyweight.FlyweightMeta.__call__ pypat.structural.flyweight.FlyweightMeta-class.html#__call__ +pypat.structural.flyweight.FlyweightMeta._serialize pypat.structural.flyweight.FlyweightMeta-class.html#_serialize diff --git a/html/class-tree.html b/html/class-tree.html new file mode 100644 index 0000000..88df853 --- /dev/null +++ b/html/class-tree.html @@ -0,0 +1,154 @@ + + + + + Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + + +
[hide private]
[frames] | no frames]
+
+
+ [ Module Hierarchy + | Class Hierarchy ] +

+

Class Hierarchy

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/crarr.png b/html/crarr.png new file mode 100644 index 0000000000000000000000000000000000000000..26b43c52433b71e72a9a478c52d446278335f0e4 GIT binary patch literal 340 zcmeAS@N?(olHy`uVBq!ia0vp^f?NMQuI$%1#8??M1uoZK z0}62#ctjR6FvuMOVaB`*rFK9;mUKs7M+SzC{oH>NS%G}l0G|-o|NsA=J-p%i`2!7U zCdJ_j4{u-SDsoA1U`TRixpVcz%O`iHHAYk?=&YaLkmD!Pp6~GW^M_S4D^grJKD>P~ zuPf!ku`N^TLavn`Edv_JSQ6wH%;50sMjDXg>*?YcQgJIe!GUqln>_|<+Os&OOUQS1 zY~Wzutud*iVS#|PHMc&?2WHoZpEo8l+6!Oc$x~=%U)469Gl^f?nq7UBw#1AXkrEde cmFKWBXcRFE*(?@T0vgQV>FVdQ&MBb@0LpZ4r2qf` literal 0 HcmV?d00001 diff --git a/html/epydoc.css b/html/epydoc.css new file mode 100644 index 0000000..86d4170 --- /dev/null +++ b/html/epydoc.css @@ -0,0 +1,322 @@ + + +/* Epydoc CSS Stylesheet + * + * This stylesheet can be used to customize the appearance of epydoc's + * HTML output. + * + */ + +/* Default Colors & Styles + * - Set the default foreground & background color with 'body'; and + * link colors with 'a:link' and 'a:visited'. + * - Use bold for decision list terms. + * - The heading styles defined here are used for headings *within* + * docstring descriptions. All headings used by epydoc itself use + * either class='epydoc' or class='toc' (CSS styles for both + * defined below). + */ +body { background: #ffffff; color: #000000; } +p { margin-top: 0.5em; margin-bottom: 0.5em; } +a:link { color: #0000ff; } +a:visited { color: #204080; } +dt { font-weight: bold; } +h1 { font-size: +140%; font-style: italic; + font-weight: bold; } +h2 { font-size: +125%; font-style: italic; + font-weight: bold; } +h3 { font-size: +110%; font-style: italic; + font-weight: normal; } +code { font-size: 100%; } +/* N.B.: class, not pseudoclass */ +a.link { font-family: monospace; } + +/* Page Header & Footer + * - The standard page header consists of a navigation bar (with + * pointers to standard pages such as 'home' and 'trees'); a + * breadcrumbs list, which can be used to navigate to containing + * classes or modules; options links, to show/hide private + * variables and to show/hide frames; and a page title (using + *

). The page title may be followed by a link to the + * corresponding source code (using 'span.codelink'). + * - The footer consists of a navigation bar, a timestamp, and a + * pointer to epydoc's homepage. + */ +h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; } +h2.epydoc { font-size: +130%; font-weight: bold; } +h3.epydoc { font-size: +115%; font-weight: bold; + margin-top: 0.2em; } +td h3.epydoc { font-size: +115%; font-weight: bold; + margin-bottom: 0; } +table.navbar { background: #a0c0ff; color: #000000; + border: 2px groove #c0d0d0; } +table.navbar table { color: #000000; } +th.navbar-select { background: #70b0ff; + color: #000000; } +table.navbar a { text-decoration: none; } +table.navbar a:link { color: #0000ff; } +table.navbar a:visited { color: #204080; } +span.breadcrumbs { font-size: 85%; font-weight: bold; } +span.options { font-size: 70%; } +span.codelink { font-size: 85%; } +td.footer { font-size: 85%; } + +/* Table Headers + * - Each summary table and details section begins with a 'header' + * row. This row contains a section title (marked by + * 'span.table-header') as well as a show/hide private link + * (marked by 'span.options', defined above). + * - Summary tables that contain user-defined groups mark those + * groups using 'group header' rows. + */ +td.table-header { background: #70b0ff; color: #000000; + border: 1px solid #608090; } +td.table-header table { color: #000000; } +td.table-header table a:link { color: #0000ff; } +td.table-header table a:visited { color: #204080; } +span.table-header { font-size: 120%; font-weight: bold; } +th.group-header { background: #c0e0f8; color: #000000; + text-align: left; font-style: italic; + font-size: 115%; + border: 1px solid #608090; } + +/* Summary Tables (functions, variables, etc) + * - Each object is described by a single row of the table with + * two cells. The left cell gives the object's type, and is + * marked with 'code.summary-type'. The right cell gives the + * object's name and a summary description. + * - CSS styles for the table's header and group headers are + * defined above, under 'Table Headers' + */ +table.summary { border-collapse: collapse; + background: #e8f0f8; color: #000000; + border: 1px solid #608090; + margin-bottom: 0.5em; } +td.summary { border: 1px solid #608090; } +code.summary-type { font-size: 85%; } +table.summary a:link { color: #0000ff; } +table.summary a:visited { color: #204080; } + + +/* Details Tables (functions, variables, etc) + * - Each object is described in its own div. + * - A single-row summary table w/ table-header is used as + * a header for each details section (CSS style for table-header + * is defined above, under 'Table Headers'). + */ +table.details { border-collapse: collapse; + background: #e8f0f8; color: #000000; + border: 1px solid #608090; + margin: .2em 0 0 0; } +table.details table { color: #000000; } +table.details a:link { color: #0000ff; } +table.details a:visited { color: #204080; } + +/* Fields */ +dl.fields { margin-left: 2em; margin-top: 1em; + margin-bottom: 1em; } +dl.fields dd ul { margin-left: 0em; padding-left: 0em; } +dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; } +div.fields { margin-left: 2em; } +div.fields p { margin-bottom: 0.5em; } + +/* Index tables (identifier index, term index, etc) + * - link-index is used for indices containing lists of links + * (namely, the identifier index & term index). + * - index-where is used in link indices for the text indicating + * the container/source for each link. + * - metadata-index is used for indices containing metadata + * extracted from fields (namely, the bug index & todo index). + */ +table.link-index { border-collapse: collapse; + background: #e8f0f8; color: #000000; + border: 1px solid #608090; } +td.link-index { border-width: 0px; } +table.link-index a:link { color: #0000ff; } +table.link-index a:visited { color: #204080; } +span.index-where { font-size: 70%; } +table.metadata-index { border-collapse: collapse; + background: #e8f0f8; color: #000000; + border: 1px solid #608090; + margin: .2em 0 0 0; } +td.metadata-index { border-width: 1px; border-style: solid; } +table.metadata-index a:link { color: #0000ff; } +table.metadata-index a:visited { color: #204080; } + +/* Function signatures + * - sig* is used for the signature in the details section. + * - .summary-sig* is used for the signature in the summary + * table, and when listing property accessor functions. + * */ +.sig-name { color: #006080; } +.sig-arg { color: #008060; } +.sig-default { color: #602000; } +.summary-sig { font-family: monospace; } +.summary-sig-name { color: #006080; font-weight: bold; } +table.summary a.summary-sig-name:link + { color: #006080; font-weight: bold; } +table.summary a.summary-sig-name:visited + { color: #006080; font-weight: bold; } +.summary-sig-arg { color: #006040; } +.summary-sig-default { color: #501800; } + +/* Subclass list + */ +ul.subclass-list { display: inline; } +ul.subclass-list li { display: inline; } + +/* To render variables, classes etc. like functions */ +table.summary .summary-name { color: #006080; font-weight: bold; + font-family: monospace; } +table.summary + a.summary-name:link { color: #006080; font-weight: bold; + font-family: monospace; } +table.summary + a.summary-name:visited { color: #006080; font-weight: bold; + font-family: monospace; } + +/* Variable values + * - In the 'variable details' sections, each varaible's value is + * listed in a 'pre.variable' box. The width of this box is + * restricted to 80 chars; if the value's repr is longer than + * this it will be wrapped, using a backslash marked with + * class 'variable-linewrap'. If the value's repr is longer + * than 3 lines, the rest will be ellided; and an ellipsis + * marker ('...' marked with 'variable-ellipsis') will be used. + * - If the value is a string, its quote marks will be marked + * with 'variable-quote'. + * - If the variable is a regexp, it is syntax-highlighted using + * the re* CSS classes. + */ +pre.variable { padding: .5em; margin: 0; + background: #dce4ec; color: #000000; + border: 1px solid #708890; } +.variable-linewrap { color: #604000; font-weight: bold; } +.variable-ellipsis { color: #604000; font-weight: bold; } +.variable-quote { color: #604000; font-weight: bold; } +.variable-group { color: #008000; font-weight: bold; } +.variable-op { color: #604000; font-weight: bold; } +.variable-string { color: #006030; } +.variable-unknown { color: #a00000; font-weight: bold; } +.re { color: #000000; } +.re-char { color: #006030; } +.re-op { color: #600000; } +.re-group { color: #003060; } +.re-ref { color: #404040; } + +/* Base tree + * - Used by class pages to display the base class hierarchy. + */ +pre.base-tree { font-size: 80%; margin: 0; } + +/* Frames-based table of contents headers + * - Consists of two frames: one for selecting modules; and + * the other listing the contents of the selected module. + * - h1.toc is used for each frame's heading + * - h2.toc is used for subheadings within each frame. + */ +h1.toc { text-align: center; font-size: 105%; + margin: 0; font-weight: bold; + padding: 0; } +h2.toc { font-size: 100%; font-weight: bold; + margin: 0.5em 0 0 -0.3em; } + +/* Syntax Highlighting for Source Code + * - doctest examples are displayed in a 'pre.py-doctest' block. + * If the example is in a details table entry, then it will use + * the colors specified by the 'table pre.py-doctest' line. + * - Source code listings are displayed in a 'pre.py-src' block. + * Each line is marked with 'span.py-line' (used to draw a line + * down the left margin, separating the code from the line + * numbers). Line numbers are displayed with 'span.py-lineno'. + * The expand/collapse block toggle button is displayed with + * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not + * modify the font size of the text.) + * - If a source code page is opened with an anchor, then the + * corresponding code block will be highlighted. The code + * block's header is highlighted with 'py-highlight-hdr'; and + * the code block's body is highlighted with 'py-highlight'. + * - The remaining py-* classes are used to perform syntax + * highlighting (py-string for string literals, py-name for names, + * etc.) + */ +pre.py-doctest { padding: .5em; margin: 1em; + background: #e8f0f8; color: #000000; + border: 1px solid #708890; } +table pre.py-doctest { background: #dce4ec; + color: #000000; } +pre.py-src { border: 2px solid #000000; + background: #f0f0f0; color: #000000; } +.py-line { border-left: 2px solid #000000; + margin-left: .2em; padding-left: .4em; } +.py-lineno { font-style: italic; font-size: 90%; + padding-left: .5em; } +a.py-toggle { text-decoration: none; } +div.py-highlight-hdr { border-top: 2px solid #000000; + border-bottom: 2px solid #000000; + background: #d8e8e8; } +div.py-highlight { border-bottom: 2px solid #000000; + background: #d0e0e0; } +.py-prompt { color: #005050; font-weight: bold;} +.py-more { color: #005050; font-weight: bold;} +.py-string { color: #006030; } +.py-comment { color: #003060; } +.py-keyword { color: #600000; } +.py-output { color: #404040; } +.py-name { color: #000050; } +.py-name:link { color: #000050 !important; } +.py-name:visited { color: #000050 !important; } +.py-number { color: #005000; } +.py-defname { color: #000060; font-weight: bold; } +.py-def-name { color: #000060; font-weight: bold; } +.py-base-class { color: #000060; } +.py-param { color: #000060; } +.py-docstring { color: #006030; } +.py-decorator { color: #804020; } +/* Use this if you don't want links to names underlined: */ +/*a.py-name { text-decoration: none; }*/ + +/* Graphs & Diagrams + * - These CSS styles are used for graphs & diagrams generated using + * Graphviz dot. 'img.graph-without-title' is used for bare + * diagrams (to remove the border created by making the image + * clickable). + */ +img.graph-without-title { border: none; } +img.graph-with-title { border: 1px solid #000000; } +span.graph-title { font-weight: bold; } +span.graph-caption { } + +/* General-purpose classes + * - 'p.indent-wrapped-lines' defines a paragraph whose first line + * is not indented, but whose subsequent lines are. + * - The 'nomargin-top' class is used to remove the top margin (e.g. + * from lists). The 'nomargin' class is used to remove both the + * top and bottom margin (but not the left or right margin -- + * for lists, that would cause the bullets to disappear.) + */ +p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em; + margin: 0; } +.nomargin-top { margin-top: 0; } +.nomargin { margin-top: 0; margin-bottom: 0; } + +/* HTML Log */ +div.log-block { padding: 0; margin: .5em 0 .5em 0; + background: #e8f0f8; color: #000000; + border: 1px solid #000000; } +div.log-error { padding: .1em .3em .1em .3em; margin: 4px; + background: #ffb0b0; color: #000000; + border: 1px solid #000000; } +div.log-warning { padding: .1em .3em .1em .3em; margin: 4px; + background: #ffffb0; color: #000000; + border: 1px solid #000000; } +div.log-info { padding: .1em .3em .1em .3em; margin: 4px; + background: #b0ffb0; color: #000000; + border: 1px solid #000000; } +h2.log-hdr { background: #70b0ff; color: #000000; + margin: 0; padding: 0em 0.5em 0em 0.5em; + border-bottom: 1px solid #000000; font-size: 110%; } +p.log { font-weight: bold; margin: .5em 0 .5em 0; } +tr.opt-changed { color: #000000; font-weight: bold; } +tr.opt-default { color: #606060; } +pre.log { margin: 0; padding: 0; padding-left: 1em; } diff --git a/html/epydoc.js b/html/epydoc.js new file mode 100644 index 0000000..e787dbc --- /dev/null +++ b/html/epydoc.js @@ -0,0 +1,293 @@ +function toggle_private() { + // Search for any private/public links on this page. Store + // their old text in "cmd," so we will know what action to + // take; and change their text to the opposite action. + var cmd = "?"; + var elts = document.getElementsByTagName("a"); + for(var i=0; i...
"; + elt.innerHTML = s; + } +} + +function toggle(id) { + elt = document.getElementById(id+"-toggle"); + if (elt.innerHTML == "-") + collapse(id); + else + expand(id); + return false; +} + +function highlight(id) { + var elt = document.getElementById(id+"-def"); + if (elt) elt.className = "py-highlight-hdr"; + var elt = document.getElementById(id+"-expanded"); + if (elt) elt.className = "py-highlight"; + var elt = document.getElementById(id+"-collapsed"); + if (elt) elt.className = "py-highlight"; +} + +function num_lines(s) { + var n = 1; + var pos = s.indexOf("\n"); + while ( pos > 0) { + n += 1; + pos = s.indexOf("\n", pos+1); + } + return n; +} + +// Collapse all blocks that mave more than `min_lines` lines. +function collapse_all(min_lines) { + var elts = document.getElementsByTagName("div"); + for (var i=0; i 0) + if (elt.id.substring(split, elt.id.length) == "-expanded") + if (num_lines(elt.innerHTML) > min_lines) + collapse(elt.id.substring(0, split)); + } +} + +function expandto(href) { + var start = href.indexOf("#")+1; + if (start != 0 && start != href.length) { + if (href.substring(start, href.length) != "-") { + collapse_all(4); + pos = href.indexOf(".", start); + while (pos != -1) { + var id = href.substring(start, pos); + expand(id); + pos = href.indexOf(".", pos+1); + } + var id = href.substring(start, href.length); + expand(id); + highlight(id); + } + } +} + +function kill_doclink(id) { + var parent = document.getElementById(id); + parent.removeChild(parent.childNodes.item(0)); +} +function auto_kill_doclink(ev) { + if (!ev) var ev = window.event; + if (!this.contains(ev.toElement)) { + var parent = document.getElementById(this.parentID); + parent.removeChild(parent.childNodes.item(0)); + } +} + +function doclink(id, name, targets_id) { + var elt = document.getElementById(id); + + // If we already opened the box, then destroy it. + // (This case should never occur, but leave it in just in case.) + if (elt.childNodes.length > 1) { + elt.removeChild(elt.childNodes.item(0)); + } + else { + // The outer box: relative + inline positioning. + var box1 = document.createElement("div"); + box1.style.position = "relative"; + box1.style.display = "inline"; + box1.style.top = 0; + box1.style.left = 0; + + // A shadow for fun + var shadow = document.createElement("div"); + shadow.style.position = "absolute"; + shadow.style.left = "-1.3em"; + shadow.style.top = "-1.3em"; + shadow.style.background = "#404040"; + + // The inner box: absolute positioning. + var box2 = document.createElement("div"); + box2.style.position = "relative"; + box2.style.border = "1px solid #a0a0a0"; + box2.style.left = "-.2em"; + box2.style.top = "-.2em"; + box2.style.background = "white"; + box2.style.padding = ".3em .4em .3em .4em"; + box2.style.fontStyle = "normal"; + box2.onmouseout=auto_kill_doclink; + box2.parentID = id; + + // Get the targets + var targets_elt = document.getElementById(targets_id); + var targets = targets_elt.getAttribute("targets"); + var links = ""; + target_list = targets.split(","); + for (var i=0; i" + + target[0] + ""; + } + + // Put it all together. + elt.insertBefore(box1, elt.childNodes.item(0)); + //box1.appendChild(box2); + box1.appendChild(shadow); + shadow.appendChild(box2); + box2.innerHTML = + "Which "+name+" do you want to see documentation for?" + + ""; + } + return false; +} + +function get_anchor() { + var href = location.href; + var start = href.indexOf("#")+1; + if ((start != 0) && (start != href.length)) + return href.substring(start, href.length); + } +function redirect_url(dottedName) { + // Scan through each element of the "pages" list, and check + // if "name" matches with any of them. + for (var i=0; i-m" or "-c"; + // extract the portion & compare it to dottedName. + var pagename = pages[i].substring(0, pages[i].length-2); + if (pagename == dottedName.substring(0,pagename.length)) { + + // We've found a page that matches `dottedName`; + // construct its URL, using leftover `dottedName` + // content to form an anchor. + var pagetype = pages[i].charAt(pages[i].length-1); + var url = pagename + ((pagetype=="m")?"-module.html": + "-class.html"); + if (dottedName.length > pagename.length) + url += "#" + dottedName.substring(pagename.length+1, + dottedName.length); + return url; + } + } + } diff --git a/html/frames.html b/html/frames.html new file mode 100644 index 0000000..6fcfe27 --- /dev/null +++ b/html/frames.html @@ -0,0 +1,17 @@ + + + + + API Documentation + + + + + + + + + diff --git a/html/help.html b/html/help.html new file mode 100644 index 0000000..eea9f80 --- /dev/null +++ b/html/help.html @@ -0,0 +1,268 @@ + + + + + Help + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + + +
[hide private]
[frames] | no frames]
+
+ +

API Documentation

+ +

This document contains the API (Application Programming Interface) +documentation for this project. Documentation for the Python +objects defined by the project is divided into separate pages for each +package, module, and class. The API documentation also includes two +pages containing information about the project as a whole: a trees +page, and an index page.

+ +

Object Documentation

+ +

Each Package Documentation page contains:

+
    +
  • A description of the package.
  • +
  • A list of the modules and sub-packages contained by the + package.
  • +
  • A summary of the classes defined by the package.
  • +
  • A summary of the functions defined by the package.
  • +
  • A summary of the variables defined by the package.
  • +
  • A detailed description of each function defined by the + package.
  • +
  • A detailed description of each variable defined by the + package.
  • +
+ +

Each Module Documentation page contains:

+
    +
  • A description of the module.
  • +
  • A summary of the classes defined by the module.
  • +
  • A summary of the functions defined by the module.
  • +
  • A summary of the variables defined by the module.
  • +
  • A detailed description of each function defined by the + module.
  • +
  • A detailed description of each variable defined by the + module.
  • +
+ +

Each Class Documentation page contains:

+
    +
  • A class inheritance diagram.
  • +
  • A list of known subclasses.
  • +
  • A description of the class.
  • +
  • A summary of the methods defined by the class.
  • +
  • A summary of the instance variables defined by the class.
  • +
  • A summary of the class (static) variables defined by the + class.
  • +
  • A detailed description of each method defined by the + class.
  • +
  • A detailed description of each instance variable defined by the + class.
  • +
  • A detailed description of each class (static) variable defined + by the class.
  • +
+ +

Project Documentation

+ +

The Trees page contains the module and class hierarchies:

+
    +
  • The module hierarchy lists every package and module, with + modules grouped into packages. At the top level, and within each + package, modules and sub-packages are listed alphabetically.
  • +
  • The class hierarchy lists every class, grouped by base + class. If a class has more than one base class, then it will be + listed under each base class. At the top level, and under each base + class, classes are listed alphabetically.
  • +
+ +

The Index page contains indices of terms and + identifiers:

+
    +
  • The term index lists every term indexed by any object's + documentation. For each term, the index provides links to each + place where the term is indexed.
  • +
  • The identifier index lists the (short) name of every package, + module, class, method, function, variable, and parameter. For each + identifier, the index provides a short description, and a link to + its documentation.
  • +
+ +

The Table of Contents

+ +

The table of contents occupies the two frames on the left side of +the window. The upper-left frame displays the project +contents, and the lower-left frame displays the module +contents:

+ + + + + + + + + +
+ Project
Contents
...
+ API
Documentation
Frame


+
+ Module
Contents
 
...
  +

+ +

The project contents frame contains a list of all packages +and modules that are defined by the project. Clicking on an entry +will display its contents in the module contents frame. Clicking on a +special entry, labeled "Everything," will display the contents of +the entire project.

+ +

The module contents frame contains a list of every +submodule, class, type, exception, function, and variable defined by a +module or package. Clicking on an entry will display its +documentation in the API documentation frame. Clicking on the name of +the module, at the top of the frame, will display the documentation +for the module itself.

+ +

The "frames" and "no frames" buttons below the top +navigation bar can be used to control whether the table of contents is +displayed or not.

+ +

The Navigation Bar

+ +

A navigation bar is located at the top and bottom of every page. +It indicates what type of page you are currently viewing, and allows +you to go to related pages. The following table describes the labels +on the navigation bar. Note that not some labels (such as +[Parent]) are not displayed on all pages.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LabelHighlighted when...Links to...
[Parent](never highlighted) the parent of the current package
[Package]viewing a packagethe package containing the current object +
[Module]viewing a modulethe module containing the current object +
[Class]viewing a class the class containing the current object
[Trees]viewing the trees page the trees page
[Index]viewing the index page the index page
[Help]viewing the help page the help page
+ +

The "show private" and "hide private" buttons below +the top navigation bar can be used to control whether documentation +for private objects is displayed. Private objects are usually defined +as objects whose (short) names begin with a single underscore, but do +not end with an underscore. For example, "_x", +"__pprint", and "epydoc.epytext._tokenize" +are private objects; but "re.sub", +"__init__", and "type_" are not. However, +if a module defines the "__all__" variable, then its +contents are used to decide which objects are private.

+ +

A timestamp below the bottom navigation bar indicates when each +page was last updated.

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/identifier-index.html b/html/identifier-index.html new file mode 100644 index 0000000..5a19abc --- /dev/null +++ b/html/identifier-index.html @@ -0,0 +1,638 @@ + + + + + Identifier Index + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + + +
[hide private]
[frames] | no frames]
+
+ +
+

Identifier Index

+
+[ + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + _ +] +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

A

+ + + + + + + + + + + + + + + + + +

B

+ + + + + + + + + + + + +

C

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

D

+ + + + + + + + + + + + + + + + + +

E

+ + + + + + + + +

F

+ + + + + + + + + + + + +

G

+ + + + + + + + +

H

+ + + + + + + + +

I

+ + + + + + + + + + + + +

M

+ + + + + + + + + + + + +

N

+ + + + + + + + +

O

+ + + + + + + + + + + + +

P

+ + + + + + + + + + + + +

R

+ + + + + + + + + + + + +

S

+ + + + + + + + + + + + + + + + + +

U

+ + + + + + + + +

V

+ + + + + + + + + + + + +

_

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..6fcfe27 --- /dev/null +++ b/html/index.html @@ -0,0 +1,17 @@ + + + + + API Documentation + + + + + + + + + diff --git a/html/module-tree.html b/html/module-tree.html new file mode 100644 index 0000000..a6afd73 --- /dev/null +++ b/html/module-tree.html @@ -0,0 +1,137 @@ + + + + + Module Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + + +
[hide private]
[frames] | no frames]
+
+
+ [ Module Hierarchy + | Class Hierarchy ] +

+

Module Hierarchy

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat-module.html b/html/pypat-module.html new file mode 100644 index 0000000..7a2f445 --- /dev/null +++ b/html/pypat-module.html @@ -0,0 +1,180 @@ + + + + + pypat + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Package pypat

source code

+ + + + + + + +
+ + + + + +
Submodules[hide private]
+
+
+ +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat-pysrc.html b/html/pypat-pysrc.html new file mode 100644 index 0000000..d775574 --- /dev/null +++ b/html/pypat-pysrc.html @@ -0,0 +1,111 @@ + + + + + pypat + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Package pypat

+
+1   
+2   
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral-module.html b/html/pypat.behavioral-module.html new file mode 100644 index 0000000..fb8888f --- /dev/null +++ b/html/pypat.behavioral-module.html @@ -0,0 +1,160 @@ + + + + + pypat.behavioral + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Package behavioral

source code

+ + + + + + + +
+ + + + + +
Submodules[hide private]
+
+
+ +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral-pysrc.html b/html/pypat.behavioral-pysrc.html new file mode 100644 index 0000000..60aaca3 --- /dev/null +++ b/html/pypat.behavioral-pysrc.html @@ -0,0 +1,112 @@ + + + + + pypat.behavioral + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Package pypat.behavioral

+
+1   
+2   
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.chain-module.html b/html/pypat.behavioral.chain-module.html new file mode 100644 index 0000000..c2b7699 --- /dev/null +++ b/html/pypat.behavioral.chain-module.html @@ -0,0 +1,139 @@ + + + + + pypat.behavioral.chain + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module chain + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module chain

source code

+ + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + ChainLink
+ Abstract ChainLink object as part of the Chain of Responsibility pattern. +
+   + + Chain
+ Abstract Chain class as part of the Chain of Responsibility pattern. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.chain-pysrc.html b/html/pypat.behavioral.chain-pysrc.html new file mode 100644 index 0000000..9335c27 --- /dev/null +++ b/html/pypat.behavioral.chain-pysrc.html @@ -0,0 +1,189 @@ + + + + + pypat.behavioral.chain + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module chain + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.behavioral.chain

+
+ 1  from abc import ABCMeta, abstractmethod 
+42   
+
43 +44 -class Chain(object, metaclass=ABCMeta): +
45 """ +46 Abstract Chain class as part of the Chain of Responsibility pattern. +47 +48 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} +49 - External Chain of Responsibility Pattern documentation: U{https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern} +50 """ +
51 - def __init__(self, chainlink): +
52 """ +53 Initialize a new Chain instance. +54 +55 @param chainlink: The starting chain link. +56 """ +57 self.chainlink = chainlink +
58 +
59 - def handle(self, request): +
60 """ +61 Handle a request. +62 +63 @param request: The request to handle. +64 """ +65 try: +66 return self.chainlink.handle(request) +67 except AttributeError: +68 return self.fail() +
69 +70 @abstractmethod +
71 - def fail(self): +
72 """ +73 The method to call when the chain could not handle a request. +74 """ +75 pass +
76 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.chain.Chain-class.html b/html/pypat.behavioral.chain.Chain-class.html new file mode 100644 index 0000000..141ac09 --- /dev/null +++ b/html/pypat.behavioral.chain.Chain-class.html @@ -0,0 +1,277 @@ + + + + + pypat.behavioral.chain.Chain + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module chain :: + Class Chain + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Chain

source code

+
+
+Abstract Chain class as part of the Chain of Responsibility pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Chain of Responsibility Pattern documentation: U{https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern}
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + chainlink)
+ Initialize a new Chain instance.
+ source code + +
+ +
+   + + + + + + +
handle(self, + request)
+ Handle a request.
+ source code + +
+ +
+   + + + + + + +
fail(self)
+ The method to call when the chain could not handle a request.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + chainlink) +
(Constructor) +

+
source code  +
+ +

Initialize a new Chain instance.

+
+
Parameters:
+
    +
  • chainlink - The starting chain link.
  • +
+
+
+
+ +
+ +
+ + +
+

handle(self, + request) +

+
source code  +
+ +

Handle a request.

+
+
Parameters:
+
    +
  • request - The request to handle.
  • +
+
+
+
+ +
+ +
+ + +
+

fail(self) +

+
source code  +
+ +

The method to call when the chain could not handle a request.

+
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.chain.ChainLink-class.html b/html/pypat.behavioral.chain.ChainLink-class.html new file mode 100644 index 0000000..a96d265 --- /dev/null +++ b/html/pypat.behavioral.chain.ChainLink-class.html @@ -0,0 +1,299 @@ + + + + + pypat.behavioral.chain.ChainLink + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module chain :: + Class ChainLink + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class ChainLink

source code

+
+
+Abstract ChainLink object as part of the Chain of Responsibility pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Chain of Responsibility Pattern documentation: U{https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern}
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self)
+ Initialize a new ChainLink instance.
+ source code + +
+ +
+   + + + + + + +
set_successor(self, + successor)
+ Set a chain link to call if this chain link fails.
+ source code + +
+ +
+   + + + + + + +
successor_handle(self, + request)
+ Have this chain links successor handle a request.
+ source code + +
+ +
+   + + + + + + +
handle(self, + request)
+ Handle a request.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

set_successor(self, + successor) +

+
source code  +
+ +

Set a chain link to call if this chain link fails.

+
+
Parameters:
+
    +
  • successor (ChainLink) - The chain link to call if this chain link fails.
  • +
+
+
+
+ +
+ +
+ + +
+

successor_handle(self, + request) +

+
source code  +
+ +

Have this chain links successor handle a request.

+
+
Parameters:
+
    +
  • request - The request to handle.
  • +
+
+
+
+ +
+ +
+ + +
+

handle(self, + request) +

+
source code  +
+ +

Handle a request.

+
+
Parameters:
+
    +
  • request - The request to handle.
  • +
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.command-module.html b/html/pypat.behavioral.command-module.html new file mode 100644 index 0000000..a976193 --- /dev/null +++ b/html/pypat.behavioral.command-module.html @@ -0,0 +1,147 @@ + + + + + pypat.behavioral.command + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module command + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module command

source code

+ + + + + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Receiver
+ Abstract receiver class as part of the Command pattern. +
+   + + Command
+ Abstract Command class as part of the Command pattern. +
+   + + Invoker
+ Abstract Invoker class as part of the Command pattern. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.command-pysrc.html b/html/pypat.behavioral.command-pysrc.html new file mode 100644 index 0000000..850be68 --- /dev/null +++ b/html/pypat.behavioral.command-pysrc.html @@ -0,0 +1,203 @@ + + + + + pypat.behavioral.command + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module command + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.behavioral.command

+
+ 1  from abc import ABCMeta, abstractmethod 
+
2 + 3 + 4 -class Receiver(object, metaclass=ABCMeta): +
5 """ + 6 Abstract receiver class as part of the Command pattern. + 7 + 8 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} + 9 - External Command Pattern documentation: U{https://en.wikipedia.org/wiki/Command_pattern} +10 """ +
11 - def action(self, name, *args, **kwargs): +
12 """ +13 Delegates which method to be called for a desired action. +14 +15 @param name: The name of the action to execute. +16 @type name: str +17 @param args: Any arguments for the action. +18 @param kwargs: Any keyword arguments for the action. +19 """ +20 try: +21 return getattr(self, name)(*args, **kwargs) +22 except AttributeError: +23 raise AttributeError('Invalid Action.') +
24 +
25 +26 -class Command(object, metaclass=ABCMeta): +
27 """ +28 Abstract Command class as part of the Command pattern. +29 +30 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} +31 - External Command Pattern documentation: U{https://en.wikipedia.org/wiki/Command_pattern} +32 """ +
33 - def __init__(self, receiver): +
34 """ +35 Initialize a new command instance. +36 +37 @param receiver: The receiver for this command to use. +38 @type receiver: Receiver +39 """ +40 self._receiver = receiver +
41 +42 @abstractmethod +
43 - def execute(self): +
44 """ +45 Abstract method for executing an action. +46 """ +47 pass +
48 +49 @abstractmethod +
50 - def unexecute(self): +
51 """ +52 Abstract method for unexecuting an action. +53 """ +54 pass +
55 +
56 +57 -class Invoker(object, metaclass=ABCMeta): +
58 """ +59 Abstract Invoker class as part of the Command pattern. +60 +61 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} +62 - External Command Pattern documentation: U{https://en.wikipedia.org/wiki/Command_pattern} +63 """ +
64 - def __init__(self, valid_commands): +
65 """ +66 Initialize a new Invoker instance. +67 +68 @param valid_commands: A list of command classes this invoker can handle. +69 """ +70 self._history = [] +71 self._valid_commands = valid_commands +
72 +
73 - def execute(self, command): +
74 """ +75 Execute a command. +76 +77 @param command: A command for the invoker to execute. +78 @type command: Command +79 """ +80 if command.__class__ not in self._valid_commands: +81 raise AttributeError('Invalid Command') +82 else: +83 self._history.append(command) +84 return command.execute() +
85 +
86 - def undo(self): +
87 """ +88 Undo the last command. +89 """ +90 return self._history.pop().unexecute() +
91 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.command.Command-class.html b/html/pypat.behavioral.command.Command-class.html new file mode 100644 index 0000000..601ef2a --- /dev/null +++ b/html/pypat.behavioral.command.Command-class.html @@ -0,0 +1,275 @@ + + + + + pypat.behavioral.command.Command + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module command :: + Class Command + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Command

source code

+
+
+Abstract Command class as part of the Command pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Command Pattern documentation: U{https://en.wikipedia.org/wiki/Command_pattern}
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + receiver)
+ Initialize a new command instance.
+ source code + +
+ +
+   + + + + + + +
execute(self)
+ Abstract method for executing an action.
+ source code + +
+ +
+   + + + + + + +
unexecute(self)
+ Abstract method for unexecuting an action.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + receiver) +
(Constructor) +

+
source code  +
+ +

Initialize a new command instance.

+
+
Parameters:
+
    +
  • receiver (Receiver) - The receiver for this command to use.
  • +
+
+
+
+ +
+ +
+ + +
+

execute(self) +

+
source code  +
+ +

Abstract method for executing an action.

+
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+ +
+ +
+ + +
+

unexecute(self) +

+
source code  +
+ +

Abstract method for unexecuting an action.

+
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.command.Invoker-class.html b/html/pypat.behavioral.command.Invoker-class.html new file mode 100644 index 0000000..516e751 --- /dev/null +++ b/html/pypat.behavioral.command.Invoker-class.html @@ -0,0 +1,254 @@ + + + + + pypat.behavioral.command.Invoker + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module command :: + Class Invoker + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Invoker

source code

+
+
+Abstract Invoker class as part of the Command pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Command Pattern documentation: U{https://en.wikipedia.org/wiki/Command_pattern}
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + valid_commands)
+ Initialize a new Invoker instance.
+ source code + +
+ +
+   + + + + + + +
execute(self, + command)
+ Execute a command.
+ source code + +
+ +
+   + + + + + + +
undo(self)
+ Undo the last command.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + valid_commands) +
(Constructor) +

+
source code  +
+ +

Initialize a new Invoker instance.

+
+
Parameters:
+
    +
  • valid_commands - A list of command classes this invoker can handle.
  • +
+
+
+
+ +
+ +
+ + +
+

execute(self, + command) +

+
source code  +
+ +

Execute a command.

+
+
Parameters:
+
    +
  • command (Command) - A command for the invoker to execute.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.command.Receiver-class.html b/html/pypat.behavioral.command.Receiver-class.html new file mode 100644 index 0000000..7e5a874 --- /dev/null +++ b/html/pypat.behavioral.command.Receiver-class.html @@ -0,0 +1,200 @@ + + + + + pypat.behavioral.command.Receiver + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module command :: + Class Receiver + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Receiver

source code

+
+
+Abstract receiver class as part of the Command pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Command Pattern documentation: U{https://en.wikipedia.org/wiki/Command_pattern}
+
+
+ + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
action(self, + name, + *args, + **kwargs)
+ Delegates which method to be called for a desired action.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

action(self, + name, + *args, + **kwargs) +

+
source code  +
+ +

Delegates which method to be called for a desired action.

+
+
Parameters:
+
    +
  • name (str) - The name of the action to execute.
  • +
  • args - Any arguments for the action.
  • +
  • kwargs - Any keyword arguments for the action.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.iterator-module.html b/html/pypat.behavioral.iterator-module.html new file mode 100644 index 0000000..19e1441 --- /dev/null +++ b/html/pypat.behavioral.iterator-module.html @@ -0,0 +1,139 @@ + + + + + pypat.behavioral.iterator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module iterator + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module iterator

source code

+ + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Iterator
+ An Iterator class for the Iterator design pattern. +
+   + + Iterable
+ An abstract class representing an Iterable object as part of the Iterator design pattern. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.iterator-pysrc.html b/html/pypat.behavioral.iterator-pysrc.html new file mode 100644 index 0000000..511baa4 --- /dev/null +++ b/html/pypat.behavioral.iterator-pysrc.html @@ -0,0 +1,152 @@ + + + + + pypat.behavioral.iterator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module iterator + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.behavioral.iterator

+
+ 1  from abc import ABCMeta, abstractmethod 
+
2 + 3 + 4 -class Iterator(object): +
5 """ + 6 An Iterator class for the Iterator design pattern. + 7 + 8 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} + 9 - External Iterator Pattern documentation: U{https://en.wikipedia.org/wiki/Iterator_pattern} +10 """ +
11 - def __init__(self, iterable): +
12 """ +13 Initialize a new Iterator instance. +14 +15 @param iterable: An Iterable object to iterate over. +16 @type iterable: Iterable +17 """ +18 self.iterable = iterable +
19 +
20 - def __iter__(self): +
21 return self +
22 +
23 - def __next__(self): +
24 return self.iterable.__next__() +
25 +
26 +27 -class Iterable(object, metaclass=ABCMeta): +
28 """ +29 An abstract class representing an Iterable object as part of the Iterator design pattern. +30 +31 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} +32 - External Iterator Pattern documentation: U{https://en.wikipedia.org/wiki/Iterator_pattern} +33 """ +34 @abstractmethod +
35 - def __next__(self): +
36 """ +37 All Iterable's must implement a __next__ method which eventually raises StopIteration. +38 """ +39 pass +
40 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.iterator.Iterable-class.html b/html/pypat.behavioral.iterator.Iterable-class.html new file mode 100644 index 0000000..b57753e --- /dev/null +++ b/html/pypat.behavioral.iterator.Iterable-class.html @@ -0,0 +1,194 @@ + + + + + pypat.behavioral.iterator.Iterable + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module iterator :: + Class Iterable + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Iterable

source code

+
+
+An abstract class representing an Iterable object as part of the Iterator design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Iterator Pattern documentation: U{https://en.wikipedia.org/wiki/Iterator_pattern}
+
+
+ + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__next__(self)
+ All Iterable's must implement a __next__ method which eventually + raises StopIteration.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__next__(self) +

+
source code  +
+ +

All Iterable's must implement a __next__ method which eventually + raises StopIteration.

+
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.iterator.Iterator-class.html b/html/pypat.behavioral.iterator.Iterator-class.html new file mode 100644 index 0000000..44cfc56 --- /dev/null +++ b/html/pypat.behavioral.iterator.Iterator-class.html @@ -0,0 +1,280 @@ + + + + + pypat.behavioral.iterator.Iterator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module iterator :: + Class Iterator + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Iterator

source code

+
+object --+
+         |
+        Iterator
+
+ +
+
+
+An Iterator class for the Iterator design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Iterator Pattern documentation: U{https://en.wikipedia.org/wiki/Iterator_pattern}
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + iterable)
+ Initialize a new Iterator instance.
+ source code + +
+ +
+   + + + + + + +
__iter__(self) + source code + +
+ +
+   + + + + + + +
__next__(self) + source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + iterable) +
(Constructor) +

+
source code  +
+ +

Initialize a new Iterator instance.

+
+
Parameters:
+
    +
  • iterable (Iterable) - An Iterable object to iterate over.
  • +
+
Overrides: + object.__init__ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.mediator-module.html b/html/pypat.behavioral.mediator-module.html new file mode 100644 index 0000000..2393d08 --- /dev/null +++ b/html/pypat.behavioral.mediator-module.html @@ -0,0 +1,156 @@ + + + + + pypat.behavioral.mediator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module mediator + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module mediator

source code

+ + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Mediator
+ Mediator class as part of the Mediator design pattern. +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = 'pypat.behavioral' +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.mediator-pysrc.html b/html/pypat.behavioral.mediator-pysrc.html new file mode 100644 index 0000000..c9a8013 --- /dev/null +++ b/html/pypat.behavioral.mediator-pysrc.html @@ -0,0 +1,162 @@ + + + + + pypat.behavioral.mediator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module mediator + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.behavioral.mediator

+
+ 1  from collections import defaultdict 
+ 2   
+ 3   
+
4 -class Mediator(object): +
5 """ + 6 Mediator class as part of the Mediator design pattern. + 7 + 8 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} + 9 - External Mediator Pattern documentation: U{https://en.wikipedia.org/wiki/Mediator_pattern} +10 """ +
11 - def __init__(self): +
12 """ +13 Initialize a new Mediator instance. +14 """ +15 self.signals = defaultdict(list) +
16 +
17 - def signal(self, signal_name, *args, **kwargs): +
18 """ +19 Send a signal out to all connected handlers. +20 +21 @param signal_name: The name of the signal. +22 @type signal_name: Str +23 @param args: Positional arguments to send with the signal. +24 @param kwargs: Keyword arguments to send with the signal. +25 """ +26 for handler in self.signals[signal_name]: +27 handler(*args, **kwargs) +
28 +
29 - def connect(self, signal_name, receiver): +
30 """ +31 Connect a receiver to a signal. +32 +33 @param signal_name: The name of the signal to connect the receiver to. +34 @type signal_name: str +35 @param receiver: A handler to call when the signal is sent out. +36 """ +37 self.signals[signal_name].append(receiver) +
38 +
39 - def disconnect(self, signal_name, receiver): +
40 """ +41 Disconnect a receiver from a signal. +42 +43 @param signal_name: The name of the signal to disconnect the receiver from. +44 @type signal_name: str +45 @param receiver: The receiver to disconnect from the signal. +46 """ +47 try: +48 self.signals[signal_name].remove(receiver) +49 except ValueError: +50 pass +
51 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.mediator.Mediator-class.html b/html/pypat.behavioral.mediator.Mediator-class.html new file mode 100644 index 0000000..bfb8a33 --- /dev/null +++ b/html/pypat.behavioral.mediator.Mediator-class.html @@ -0,0 +1,380 @@ + + + + + pypat.behavioral.mediator.Mediator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module mediator :: + Class Mediator + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Mediator

source code

+
+object --+
+         |
+        Mediator
+
+ +
+
+
+Mediator class as part of the Mediator design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Mediator Pattern documentation: U{https://en.wikipedia.org/wiki/Mediator_pattern}
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self)
+ Initialize a new Mediator instance.
+ source code + +
+ +
+   + + + + + + +
signal(self, + signal_name, + *args, + **kwargs)
+ Send a signal out to all connected handlers.
+ source code + +
+ +
+   + + + + + + +
connect(self, + signal_name, + receiver)
+ Connect a receiver to a signal.
+ source code + +
+ +
+   + + + + + + +
disconnect(self, + signal_name, + receiver)
+ Disconnect a receiver from a signal.
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self) +
(Constructor) +

+
source code  +
+ +

Initialize a new Mediator instance.

+
+
Overrides: + object.__init__ +
+
+
+
+ +
+ +
+ + +
+

signal(self, + signal_name, + *args, + **kwargs) +

+
source code  +
+ +

Send a signal out to all connected handlers.

+
+
Parameters:
+
    +
  • signal_name (Str) - The name of the signal.
  • +
  • args - Positional arguments to send with the signal.
  • +
  • kwargs - Keyword arguments to send with the signal.
  • +
+
+
+
+ +
+ +
+ + +
+

connect(self, + signal_name, + receiver) +

+
source code  +
+ +

Connect a receiver to a signal.

+
+
Parameters:
+
    +
  • signal_name (str) - The name of the signal to connect the receiver to.
  • +
  • receiver - A handler to call when the signal is sent out.
  • +
+
+
+
+ +
+ +
+ + +
+

disconnect(self, + signal_name, + receiver) +

+
source code  +
+ +

Disconnect a receiver from a signal.

+
+
Parameters:
+
    +
  • signal_name (str) - The name of the signal to disconnect the receiver from.
  • +
  • receiver - The receiver to disconnect from the signal.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.memento-module.html b/html/pypat.behavioral.memento-module.html new file mode 100644 index 0000000..3a91867 --- /dev/null +++ b/html/pypat.behavioral.memento-module.html @@ -0,0 +1,164 @@ + + + + + pypat.behavioral.memento + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module memento + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module memento

source code

+ + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Memento
+ Memento class as part of the Memento design pattern. +
+   + + Originator
+ Originator base class as part of the Memento design pattern. +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = 'pypat.behavioral' +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.memento-pysrc.html b/html/pypat.behavioral.memento-pysrc.html new file mode 100644 index 0000000..e727ddb --- /dev/null +++ b/html/pypat.behavioral.memento-pysrc.html @@ -0,0 +1,159 @@ + + + + + pypat.behavioral.memento + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module memento + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.behavioral.memento

+
+ 1  from copy import deepcopy 
+
2 + 3 + 4 -class Memento(object): +
5 """ + 6 Memento class as part of the Memento design pattern. + 7 + 8 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} + 9 - External Memento Pattern documentation: U{https://en.wikipedia.org/wiki/Memento_pattern} +10 """ +
11 - def __init__(self, state): +
12 """ +13 Initialize a new Memento instance. +14 +15 @param state: The state to save in this Memento. +16 @type state: dict +17 """ +18 self.__state = state +
19 +20 @property +
21 - def state(self): +
22 return self.__state +
23 +
24 +25 -class Originator(object): +
26 """ +27 Originator base class as part of the Memento design pattern. +28 +29 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} +30 - External Mediator Pattern documentation: U{https://en.wikipedia.org/wiki/Memento_pattern} +31 """ +
32 - def commit(self): +
33 """ +34 Commit this objects state to a memento. +35 +36 @return: A memento instance with this objects state. +37 """ +38 return Memento(deepcopy(self.__dict__)) +
39 +
40 - def rollback(self, memento): +
41 """ +42 Rollback this objects state to a previous state. +43 +44 @param memento: The memento object holding the state to rollback to. +45 @type memento: Memento +46 """ +47 self.__dict__ = memento.state +
48 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.memento.Memento-class.html b/html/pypat.behavioral.memento.Memento-class.html new file mode 100644 index 0000000..6e09efc --- /dev/null +++ b/html/pypat.behavioral.memento.Memento-class.html @@ -0,0 +1,288 @@ + + + + + pypat.behavioral.memento.Memento + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module memento :: + Class Memento + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Memento

source code

+
+object --+
+         |
+        Memento
+
+ +
+
+
+Memento class as part of the Memento design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Memento Pattern documentation: U{https://en.wikipedia.org/wiki/Memento_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + state)
+ Initialize a new Memento instance.
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+   + + state +
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + state) +
(Constructor) +

+
source code  +
+ +

Initialize a new Memento instance.

+
+
Parameters:
+
    +
  • state (dict) - The state to save in this Memento.
  • +
+
Overrides: + object.__init__ +
+
+
+
+
+ + + + + + +
+ + + + + +
Property Details[hide private]
+
+ +
+ +
+

state

+ +
+
Get Method:
+
unreachable.state(self) +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.memento.Originator-class.html b/html/pypat.behavioral.memento.Originator-class.html new file mode 100644 index 0000000..3ebf1cd --- /dev/null +++ b/html/pypat.behavioral.memento.Originator-class.html @@ -0,0 +1,283 @@ + + + + + pypat.behavioral.memento.Originator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module memento :: + Class Originator + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Originator

source code

+
+object --+
+         |
+        Originator
+
+ +
+
+
+Originator base class as part of the Memento design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Mediator Pattern documentation: U{https://en.wikipedia.org/wiki/Memento_pattern}
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
commit(self)
+ Commit this objects state to a memento.
+ source code + +
+ +
+   + + + + + + +
rollback(self, + memento)
+ Rollback this objects state to a previous state.
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __init__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

commit(self) +

+
source code  +
+ +

Commit this objects state to a memento.

+
+
Returns:
+
A memento instance with this objects state.
+
+
+
+ +
+ +
+ + +
+

rollback(self, + memento) +

+
source code  +
+ +

Rollback this objects state to a previous state.

+
+
Parameters:
+
    +
  • memento (Memento) - The memento object holding the state to rollback to.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.null-module.html b/html/pypat.behavioral.null-module.html new file mode 100644 index 0000000..2807394 --- /dev/null +++ b/html/pypat.behavioral.null-module.html @@ -0,0 +1,156 @@ + + + + + pypat.behavioral.null + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module null + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module null

source code

+ + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Null
+ A Null object class as part of the Null object design pattern. +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.null-pysrc.html b/html/pypat.behavioral.null-pysrc.html new file mode 100644 index 0000000..b5a7064 --- /dev/null +++ b/html/pypat.behavioral.null-pysrc.html @@ -0,0 +1,187 @@ + + + + + pypat.behavioral.null + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module null + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.behavioral.null

+
+
1 -class Null(object): +
2 """ + 3 A Null object class as part of the Null object design pattern. + 4 + 5 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} + 6 - External Null Object Pattern documentation: U{https://en.wikipedia.org/wiki/Null_Object_pattern} + 7 """ +
8 - def __init__(self, *args, **kwargs): +
9 """ +10 Do nothing. +11 """ +12 pass +
13 +
14 - def __call__(self, *args, **kwargs): +
15 """ +16 Do nothing. +17 +18 @return: This object instance. +19 @rtype: Null +20 """ +21 return self +
22 +
23 - def __getattr__(self, name): +
24 """ +25 Do nothing. +26 +27 @return: This object instance. +28 @rtype: Null +29 """ +30 return self +
31 +
32 - def __setattr__(self, name, value): +
33 """ +34 Do nothing. +35 +36 @return: This object instance. +37 @rtype: Null +38 """ +39 return self +
40 +
41 - def __delattr__(self, name): +
42 """ +43 Do nothing. +44 +45 @return: This object instance. +46 @rtype: Null +47 """ +48 return self +
49 +
50 - def __repr__(self): +
51 """ +52 Null object string representation is the empty string. +53 +54 @return: An empty string. +55 @rtype: String +56 """ +57 return '' +
58 +
59 - def __str__(self): +
60 """ +61 Null object string representation is the empty string. +62 +63 @return: An empty string. +64 @rtype: String +65 """ +66 return '' +
67 +
68 - def __bool__(self): +
69 """ +70 Null object evaluates to False. +71 +72 @return: False. +73 @rtype: Boolean +74 """ +75 return False +
76 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.null.Null-class.html b/html/pypat.behavioral.null.Null-class.html new file mode 100644 index 0000000..d710f15 --- /dev/null +++ b/html/pypat.behavioral.null.Null-class.html @@ -0,0 +1,536 @@ + + + + + pypat.behavioral.null.Null + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module null :: + Class Null + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Null

source code

+
+object --+
+         |
+        Null
+
+ +
+
+
+A Null object class as part of the Null object design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Null Object Pattern documentation: U{https://en.wikipedia.org/wiki/Null_Object_pattern}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + *args, + **kwargs)
+ Do nothing.
+ source code + +
+ +
+ Null + + + + + + +
__call__(self, + *args, + **kwargs)
+ Do nothing.
+ source code + +
+ +
+ Null + + + + + + +
__getattr__(self, + name)
+ Do nothing.
+ source code + +
+ +
+ Null + + + + + + +
__setattr__(self, + name, + value)
+ Do nothing.
+ source code + +
+ +
+ Null + + + + + + +
__delattr__(self, + name)
+ Do nothing.
+ source code + +
+ +
+ String + + + + + + +
__repr__(self)
+ Null object string representation is the empty string.
+ source code + +
+ +
+ String + + + + + + +
__str__(self)
+ Null object string representation is the empty string.
+ source code + +
+ +
+ Boolean + + + + + + +
__bool__(self)
+ Null object evaluates to False.
+ source code + +
+ +
+

Inherited from object: + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __sizeof__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + *args, + **kwargs) +
(Constructor) +

+
source code  +
+ +

Do nothing.

+
+
Overrides: + object.__init__ +
+
+
+
+ +
+ +
+ + +
+

__call__(self, + *args, + **kwargs) +
(Call operator) +

+
source code  +
+ +

Do nothing.

+
+
Returns: Null
+
This object instance.
+
+
+
+ +
+ +
+ + +
+

__getattr__(self, + name) +
(Qualification operator) +

+
source code  +
+ +

Do nothing.

+
+
Returns: Null
+
This object instance.
+
+
+
+ +
+ +
+ + +
+

__setattr__(self, + name, + value) +

+
source code  +
+ +

Do nothing.

+
+
Returns: Null
+
This object instance.
+
Overrides: + object.__setattr__ +
+
+
+
+ +
+ +
+ + +
+

__delattr__(self, + name) +

+
source code  +
+ +

Do nothing.

+
+
Returns: Null
+
This object instance.
+
Overrides: + object.__delattr__ +
+
+
+
+ +
+ +
+ + +
+

__repr__(self) +
(Representation operator) +

+
source code  +
+ +

Null object string representation is the empty string.

+
+
Returns: String
+
An empty string.
+
Overrides: + object.__repr__ +
+
+
+
+ +
+ +
+ + +
+

__str__(self) +
(Informal representation operator) +

+
source code  +
+ +

Null object string representation is the empty string.

+
+
Returns: String
+
An empty string.
+
Overrides: + object.__str__ +
+
+
+
+ +
+ +
+ + +
+

__bool__(self) +

+
source code  +
+ +

Null object evaluates to False.

+
+
Returns: Boolean
+
False.
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.observer-module.html b/html/pypat.behavioral.observer-module.html new file mode 100644 index 0000000..e6adfe6 --- /dev/null +++ b/html/pypat.behavioral.observer-module.html @@ -0,0 +1,139 @@ + + + + + pypat.behavioral.observer + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module observer + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module observer

source code

+ + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Observer
+ Abstract Observer class as part of the Observer design pattern. +
+   + + Observable
+ Base Observable class as part of the Observer design pattern. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.observer-pysrc.html b/html/pypat.behavioral.observer-pysrc.html new file mode 100644 index 0000000..b5b1b63 --- /dev/null +++ b/html/pypat.behavioral.observer-pysrc.html @@ -0,0 +1,171 @@ + + + + + pypat.behavioral.observer + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module observer + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.behavioral.observer

+
+ 1  from abc import ABCMeta, abstractmethod 
+
2 + 3 + 4 -class Observer(object, metaclass=ABCMeta): +
5 """ + 6 Abstract Observer class as part of the Observer design pattern. + 7 + 8 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} + 9 - External Observer Pattern documentation: U{https://en.wikipedia.org/wiki/Observer_pattern} +10 """ +11 @abstractmethod +
12 - def update(self, **state): +
13 """ +14 Abstract method that is called when an Observable's state changes. +15 """ +16 pass +
17 +
18 +19 -class Observable(object): +
20 """ +21 Base Observable class as part of the Observer design pattern. +22 +23 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} +24 - External Observer Pattern documentation: U{https://en.wikipedia.org/wiki/Observer_pattern} +25 """ +
26 - def __init__(self): +
27 """ +28 Initialize a new Observable instance. +29 """ +30 self._observers = set() +
31 +
32 - def attach(self, observer): +
33 """ +34 Attach an observer to this Observable. +35 +36 @param observer: The Observer to attach. +37 @type observer: Observer +38 """ +39 self._observers.add(observer) +
40 +
41 - def detach(self, observer): +
42 """ +43 Detach an observer from this Observable. +44 +45 @param observer: The Observer to detach. +46 @type observer: Observer +47 """ +48 try: +49 self._observers.remove(observer) +50 except KeyError: +51 pass +
52 +
53 - def notify(self): +
54 """ +55 Notify all attached Observers of the state of this Observable. +56 """ +57 for observer in self._observers: +58 state = {k: v for k, v in self.__dict__.items() if not k.startswith('__') and not k.startswith('_')} +59 observer.update(**state) +
60 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.observer.Observable-class.html b/html/pypat.behavioral.observer.Observable-class.html new file mode 100644 index 0000000..e7e0a66 --- /dev/null +++ b/html/pypat.behavioral.observer.Observable-class.html @@ -0,0 +1,343 @@ + + + + + pypat.behavioral.observer.Observable + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module observer :: + Class Observable + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Observable

source code

+
+object --+
+         |
+        Observable
+
+ +
+
+
+Base Observable class as part of the Observer design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Observer Pattern documentation: U{https://en.wikipedia.org/wiki/Observer_pattern}
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self)
+ Initialize a new Observable instance.
+ source code + +
+ +
+   + + + + + + +
attach(self, + observer)
+ Attach an observer to this Observable.
+ source code + +
+ +
+   + + + + + + +
detach(self, + observer)
+ Detach an observer from this Observable.
+ source code + +
+ +
+   + + + + + + +
notify(self)
+ Notify all attached Observers of the state of this Observable.
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self) +
(Constructor) +

+
source code  +
+ +

Initialize a new Observable instance.

+
+
Overrides: + object.__init__ +
+
+
+
+ +
+ +
+ + +
+

attach(self, + observer) +

+
source code  +
+ +

Attach an observer to this Observable.

+
+
Parameters:
+
    +
  • observer (Observer) - The Observer to attach.
  • +
+
+
+
+ +
+ +
+ + +
+

detach(self, + observer) +

+
source code  +
+ +

Detach an observer from this Observable.

+
+
Parameters:
+
    +
  • observer (Observer) - The Observer to detach.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.observer.Observer-class.html b/html/pypat.behavioral.observer.Observer-class.html new file mode 100644 index 0000000..aaf6159 --- /dev/null +++ b/html/pypat.behavioral.observer.Observer-class.html @@ -0,0 +1,194 @@ + + + + + pypat.behavioral.observer.Observer + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module observer :: + Class Observer + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Observer

source code

+
+
+Abstract Observer class as part of the Observer design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Observer Pattern documentation: U{https://en.wikipedia.org/wiki/Observer_pattern}
+
+
+ + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
update(self, + **state)
+ Abstract method that is called when an Observable's state changes.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

update(self, + **state) +

+
source code  +
+ +

Abstract method that is called when an Observable's state changes.

+
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.visitor-module.html b/html/pypat.behavioral.visitor-module.html new file mode 100644 index 0000000..52d1a4f --- /dev/null +++ b/html/pypat.behavioral.visitor-module.html @@ -0,0 +1,139 @@ + + + + + pypat.behavioral.visitor + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module visitor + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module visitor

source code

+ + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Visitor
+ Abstract Visitor class as part of the Visitor Design Pattern. +
+   + + Visitee
+ A base class for objects that wish to be able to be visited by a Visitor class. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.visitor-pysrc.html b/html/pypat.behavioral.visitor-pysrc.html new file mode 100644 index 0000000..c29704b --- /dev/null +++ b/html/pypat.behavioral.visitor-pysrc.html @@ -0,0 +1,170 @@ + + + + + pypat.behavioral.visitor + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module visitor + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.behavioral.visitor

+
+ 1  from abc import ABCMeta, abstractmethod 
+
2 + 3 + 4 -class Visitor(metaclass=ABCMeta): +
5 """ + 6 Abstract Visitor class as part of the Visitor Design Pattern. + 7 + 8 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} + 9 - External Visitor Design Pattern documentation: U{https://en.wikipedia.org/wiki/Visitor_pattern} +10 """ +
11 - def visit(self, node, *args, **kwargs): +
12 """ +13 Visit the visitor with some object. +14 +15 @param node: An object to call a visitor method with. +16 @param args: Arguments to go with the visitor method call. +17 @param kwargs: Keyword arguments to go with the visitor method call. +18 @return: The return value of the method that was called for visiting object. +19 """ +20 method = None +21 for cls in node.__class__.__mro__: +22 method_name = 'visit_'+cls.__name__.lower() +23 method = getattr(self, method_name, None) +24 if method: +25 break +26 +27 if not method: +28 method = self.generic_visit +29 return method(node, *args, **kwargs) +
30 +31 @abstractmethod +
32 - def generic_visit(self, node, *args, **kwargs): +
33 """ +34 The method to call if no methods were found for a visiting object. +35 +36 @param node: An object to call a visitor method with. +37 @param args: Arguments to go with the visitor method call. +38 @param kwargs: Keyword arguments to go with the visitor method call. +39 """ +
40 +
41 +42 -class Visitee(object): +
43 """ +44 A base class for objects that wish to be able to be visited by a Visitor class. +45 +46 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage} +47 - External Visitor Design Pattern documentation: U{https://en.wikipedia.org/wiki/Visitor_pattern} +48 """ +
49 - def accept(self, visitor, *args, **kwargs): +
50 """ +51 Have a visitor visit this class instance. +52 +53 @param visitor: The visitor to visit. +54 @type visitor: Visitor +55 @param args: Any args to send with the visit. +56 @param kwargs: Any kwargs to send with the visit. +57 """ +58 return visitor.visit(self, *args, **kwargs) +
59 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.visitor.Visitee-class.html b/html/pypat.behavioral.visitor.Visitee-class.html new file mode 100644 index 0000000..8d4b0e4 --- /dev/null +++ b/html/pypat.behavioral.visitor.Visitee-class.html @@ -0,0 +1,251 @@ + + + + + pypat.behavioral.visitor.Visitee + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module visitor :: + Class Visitee + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Visitee

source code

+
+object --+
+         |
+        Visitee
+
+ +
+
+
+A base class for objects that wish to be able to be visited by a Visitor class.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Visitor Design Pattern documentation: U{https://en.wikipedia.org/wiki/Visitor_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
accept(self, + visitor, + *args, + **kwargs)
+ Have a visitor visit this class instance.
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __init__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

accept(self, + visitor, + *args, + **kwargs) +

+
source code  +
+ +

Have a visitor visit this class instance.

+
+
Parameters:
+
    +
  • visitor (Visitor) - The visitor to visit.
  • +
  • args - Any args to send with the visit.
  • +
  • kwargs - Any kwargs to send with the visit.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.behavioral.visitor.Visitor-class.html b/html/pypat.behavioral.visitor.Visitor-class.html new file mode 100644 index 0000000..ed36aea --- /dev/null +++ b/html/pypat.behavioral.visitor.Visitor-class.html @@ -0,0 +1,255 @@ + + + + + pypat.behavioral.visitor.Visitor + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package behavioral :: + Module visitor :: + Class Visitor + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Visitor

source code

+
+
+Abstract Visitor class as part of the Visitor Design Pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
+- External Visitor Design Pattern documentation: U{https://en.wikipedia.org/wiki/Visitor_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
visit(self, + node, + *args, + **kwargs)
+ Visit the visitor with some object.
+ source code + +
+ +
+   + + + + + + +
generic_visit(self, + node, + *args, + **kwargs)
+ The method to call if no methods were found for a visiting object.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

visit(self, + node, + *args, + **kwargs) +

+
source code  +
+ +

Visit the visitor with some object.

+
+
Parameters:
+
    +
  • node - An object to call a visitor method with.
  • +
  • args - Arguments to go with the visitor method call.
  • +
  • kwargs - Keyword arguments to go with the visitor method call.
  • +
+
Returns:
+
The return value of the method that was called for visiting + object.
+
+
+
+ +
+ +
+ + +
+

generic_visit(self, + node, + *args, + **kwargs) +

+
source code  +
+ +

The method to call if no methods were found for a visiting object.

+
+
Parameters:
+
    +
  • node - An object to call a visitor method with.
  • +
  • args - Arguments to go with the visitor method call.
  • +
  • kwargs - Keyword arguments to go with the visitor method call.
  • +
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational-module.html b/html/pypat.creational-module.html new file mode 100644 index 0000000..0b7d567 --- /dev/null +++ b/html/pypat.creational-module.html @@ -0,0 +1,157 @@ + + + + + pypat.creational + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Package creational

source code

+ + + + + + + +
+ + + + + +
Submodules[hide private]
+
+
+ +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational-pysrc.html b/html/pypat.creational-pysrc.html new file mode 100644 index 0000000..f686bdb --- /dev/null +++ b/html/pypat.creational-pysrc.html @@ -0,0 +1,112 @@ + + + + + pypat.creational + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Package pypat.creational

+
+1   
+2   
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.builder-module.html b/html/pypat.creational.builder-module.html new file mode 100644 index 0000000..1cc14bc --- /dev/null +++ b/html/pypat.creational.builder-module.html @@ -0,0 +1,139 @@ + + + + + pypat.creational.builder + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module builder + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module builder

source code

+ + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Director
+ Abstract director class, responsible for using a builder to fully construct an object. +
+   + + Builder
+ Abstract builder class, responsible for constructing various pieces of an object. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.builder-pysrc.html b/html/pypat.creational.builder-pysrc.html new file mode 100644 index 0000000..6409ce3 --- /dev/null +++ b/html/pypat.creational.builder-pysrc.html @@ -0,0 +1,191 @@ + + + + + pypat.creational.builder + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module builder + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.creational.builder

+
+ 1  from abc import ABCMeta, abstractmethod 
+
2 + 3 + 4 -class Director(object, metaclass=ABCMeta): +
5 """ + 6 Abstract director class, responsible for using a builder to fully construct an object. + 7 + 8 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage} + 9 - External Builder Pattern documentation: U{https://en.wikipedia.org/wiki/Builder_pattern} +10 """ +11 +
12 - def __init__(self): +
13 """ +14 Initialize a new Director. +15 """ +16 self.builder = None +
17 +18 @abstractmethod +
19 - def construct(self): +
20 """ +21 Abstract method for fully constructing an object. +22 +23 Concrete implementations should override this and use a builder to construct the object. +24 +25 @raise NotImplementedError: If this method is not overridden. +26 """ +27 pass +
28 +
29 - def get_constructed_object(self): +
30 """ +31 Get the object this director is responsible for constructing. +32 +33 @return: The object that this director is responsible for constructing. +34 """ +35 return self.builder.constructed_object +
36 +
37 +38 -class Builder(object, metaclass=ABCMeta): +
39 """ +40 Abstract builder class, responsible for constructing various pieces of an object. +41 +42 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage} +43 - External Builder Pattern documentation: U{https://en.wikipedia.org/wiki/Builder_pattern} +44 """ +45 +
46 - def __init__(self, constructed_object): +
47 """ +48 Initialize a new Builder. +49 +50 Concrete Builders should call this method from within their own __init__ method. +51 The concrete __init__ method should also register all build options to build methods, +52 by using the _register method. +53 +54 @param constructed_object: An instance of an object this builder is responsible for. +55 """ +56 self.constructed_object = constructed_object +57 self.build_methods = dict() +
58 +
59 - def build(self, build_option, **kwargs): +
60 """ +61 Build a piece of the constructed object. +62 +63 @param build_option: The part of the object to build. All build options should have been registered in __init__. +64 @type build_option: str +65 @param kwargs: Additional arguments for building. +66 """ +67 self.build_methods[build_option](**kwargs) +
68 +
69 - def _register(self, build_option, build_method): +
70 """ +71 Register a build option to a build method. +72 +73 All concrete builders should call this method in their constructor at least once. +74 +75 @param build_option: A string representing the part of the object to build. +76 @type build_option: str +77 @param build_method: The method to call when given build option is selected. +78 """ +79 self.build_methods[build_option] = build_method +
80 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.builder.Builder-class.html b/html/pypat.creational.builder.Builder-class.html new file mode 100644 index 0000000..eea74e1 --- /dev/null +++ b/html/pypat.creational.builder.Builder-class.html @@ -0,0 +1,291 @@ + + + + + pypat.creational.builder.Builder + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module builder :: + Class Builder + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Builder

source code

+
+
+Abstract builder class, responsible for constructing various pieces of an object.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
+- External Builder Pattern documentation: U{https://en.wikipedia.org/wiki/Builder_pattern}
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + constructed_object)
+ Initialize a new Builder.
+ source code + +
+ +
+   + + + + + + +
build(self, + build_option, + **kwargs)
+ Build a piece of the constructed object.
+ source code + +
+ +
+   + + + + + + +
_register(self, + build_option, + build_method)
+ Register a build option to a build method.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + constructed_object) +
(Constructor) +

+
source code  +
+ +

Initialize a new Builder.

+

Concrete Builders should call this method from within their own + __init__ method. The concrete __init__ method should also register all + build options to build methods, by using the _register method.

+
+
Parameters:
+
    +
  • constructed_object - An instance of an object this builder is responsible for.
  • +
+
+
+
+ +
+ +
+ + +
+

build(self, + build_option, + **kwargs) +

+
source code  +
+ +

Build a piece of the constructed object.

+
+
Parameters:
+
    +
  • build_option (str) - The part of the object to build. All build options should have + been registered in __init__.
  • +
  • kwargs - Additional arguments for building.
  • +
+
+
+
+ +
+ +
+ + +
+

_register(self, + build_option, + build_method) +

+
source code  +
+ +

Register a build option to a build method.

+

All concrete builders should call this method in their constructor at + least once.

+
+
Parameters:
+
    +
  • build_option (str) - A string representing the part of the object to build.
  • +
  • build_method - The method to call when given build option is selected.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.builder.Director-class.html b/html/pypat.creational.builder.Director-class.html new file mode 100644 index 0000000..162ebfa --- /dev/null +++ b/html/pypat.creational.builder.Director-class.html @@ -0,0 +1,253 @@ + + + + + pypat.creational.builder.Director + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module builder :: + Class Director + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Director

source code

+
+
+Abstract director class, responsible for using a builder to fully construct an object.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
+- External Builder Pattern documentation: U{https://en.wikipedia.org/wiki/Builder_pattern}
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self)
+ Initialize a new Director.
+ source code + +
+ +
+   + + + + + + +
construct(self)
+ Abstract method for fully constructing an object.
+ source code + +
+ +
+   + + + + + + +
get_constructed_object(self)
+ Get the object this director is responsible for constructing.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

construct(self) +

+
source code  +
+ +

Abstract method for fully constructing an object.

+

Concrete implementations should override this and use a builder to + construct the object.

+
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
Raises:
+
    +
  • NotImplementedError - If this method is not overridden.
  • +
+
+
+
+ +
+ +
+ + +
+

get_constructed_object(self) +

+
source code  +
+ +

Get the object this director is responsible for constructing.

+
+
Returns:
+
The object that this director is responsible for constructing.
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.factory-module.html b/html/pypat.creational.factory-module.html new file mode 100644 index 0000000..6a6d783 --- /dev/null +++ b/html/pypat.creational.factory-module.html @@ -0,0 +1,139 @@ + + + + + pypat.creational.factory + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module factory + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module factory

source code

+ + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Factory
+ Factory Interface. +
+   + + AbstractFactory
+ Abstract Factory Class as part of the AbstractFactory design pattern. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.factory-pysrc.html b/html/pypat.creational.factory-pysrc.html new file mode 100644 index 0000000..ede479c --- /dev/null +++ b/html/pypat.creational.factory-pysrc.html @@ -0,0 +1,172 @@ + + + + + pypat.creational.factory + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module factory + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.creational.factory

+
+ 1  from abc import abstractmethod, ABCMeta 
+
2 + 3 + 4 -class Factory(object, metaclass=ABCMeta): +
5 """ + 6 Factory Interface. + 7 + 8 All Factories should inherit this class and overwrite the create method. + 9 +10 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage} +11 - External Factory Pattern documentation: U{https://en.wikipedia.org/wiki/Factory_method_pattern} +12 """ +13 @abstractmethod +
14 - def create(self, **kwargs): +
15 """ +16 Abstract create method. +17 +18 Concrete implementations should return a new instance of the object the factory class is responsible for. +19 @param kwargs: Arguments for object creation. +20 @return: A new instance of the object the factory is responsible for. +21 """ +22 pass +
23 +
24 +25 -class AbstractFactory(Factory, metaclass=ABCMeta): +
26 """ +27 Abstract Factory Class as part of the AbstractFactory design pattern. +28 +29 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage} +30 - External Abstract Factory Pattern documentation: U{https://en.wikipedia.org/wiki/Abstract_factory_pattern} +31 """ +
32 - def __init__(self): +
33 """ +34 Initialize the abstract factory. +35 +36 Concrete implementations should call this from within their own __init__ method +37 and register all their factories to keys using the register method. +38 """ +39 self._factories = dict() +
40 +41 @abstractmethod +
42 - def create(self, **kwargs): +
43 """ +44 Abstract create method. +45 +46 Concrete implementations should return a new instance of an object by calling the appropriate factory. +47 +48 @param kwargs: Arguments for object creation. +49 """ +50 pass +
51 +
52 - def _register(self, key, factory): +
53 """ +54 Register a factory to a key. +55 +56 @param key: Key for identifying which factory to use. +57 @type key: str +58 @param factory: The factory to register to the key. +59 """ +60 self._factories[str(key)] = factory +
61 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.factory.AbstractFactory-class.html b/html/pypat.creational.factory.AbstractFactory-class.html new file mode 100644 index 0000000..e9ba17c --- /dev/null +++ b/html/pypat.creational.factory.AbstractFactory-class.html @@ -0,0 +1,285 @@ + + + + + pypat.creational.factory.AbstractFactory + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module factory :: + Class AbstractFactory + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class AbstractFactory

source code

+
+
+Abstract Factory Class as part of the AbstractFactory design pattern.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
+- External Abstract Factory Pattern documentation: U{https://en.wikipedia.org/wiki/Abstract_factory_pattern}
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self)
+ Initialize the abstract factory.
+ source code + +
+ +
+   + + + + + + +
create(self, + **kwargs)
+ Abstract create method.
+ source code + +
+ +
+   + + + + + + +
_register(self, + key, + factory)
+ Register a factory to a key.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self) +
(Constructor) +

+
source code  +
+ +

Initialize the abstract factory.

+

Concrete implementations should call this from within their own + __init__ method and register all their factories to keys using the + register method.

+
+
+
+
+ +
+ +
+ + +
+

create(self, + **kwargs) +

+
source code  +
+ +

Abstract create method.

+

Concrete implementations should return a new instance of an object by + calling the appropriate factory.

+
+
Parameters:
+
    +
  • kwargs - Arguments for object creation.
  • +
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+ +
+ +
+ + +
+

_register(self, + key, + factory) +

+
source code  +
+ +

Register a factory to a key.

+
+
Parameters:
+
    +
  • key (str) - Key for identifying which factory to use.
  • +
  • factory - The factory to register to the key.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.factory.Factory-class.html b/html/pypat.creational.factory.Factory-class.html new file mode 100644 index 0000000..a7de96b --- /dev/null +++ b/html/pypat.creational.factory.Factory-class.html @@ -0,0 +1,204 @@ + + + + + pypat.creational.factory.Factory + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module factory :: + Class Factory + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Factory

source code

+
+
+Factory Interface.
+
+All Factories should inherit this class and overwrite the create method.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
+- External Factory Pattern documentation: U{https://en.wikipedia.org/wiki/Factory_method_pattern}
+
+
+ + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
create(self, + **kwargs)
+ Abstract create method.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

create(self, + **kwargs) +

+
source code  +
+ +

Abstract create method.

+

Concrete implementations should return a new instance of the object + the factory class is responsible for.

+
+
Parameters:
+
    +
  • kwargs - Arguments for object creation.
  • +
+
Returns:
+
A new instance of the object the factory is responsible for.
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.pool-module.html b/html/pypat.creational.pool-module.html new file mode 100644 index 0000000..ae38c8d --- /dev/null +++ b/html/pypat.creational.pool-module.html @@ -0,0 +1,139 @@ + + + + + pypat.creational.pool + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module pool + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module pool

source code

+ + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Reusable
+ An abstract reusable class. +
+   + + Pool
+ An Object Pool design pattern implementation. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.pool-pysrc.html b/html/pypat.creational.pool-pysrc.html new file mode 100644 index 0000000..c9234cb --- /dev/null +++ b/html/pypat.creational.pool-pysrc.html @@ -0,0 +1,187 @@ + + + + + pypat.creational.pool + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module pool + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.creational.pool

+
+ 1  from abc import ABCMeta 
+ 2  from copy import deepcopy 
+ 3  from pypat.behavioral.memento import Originator 
+ 4   
+ 5   
+
6 -class Reusable(Originator, metaclass=ABCMeta): +
7 """ + 8 An abstract reusable class. + 9 +10 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage} +11 - External Object Pool Pattern documentation: U{https://en.wikipedia.org/wiki/Object_pool_pattern} +12 """ +
13 - def __init__(self): +
14 """ +15 Initialize a new Reusable instance. +16 """ +17 self.memento = self.commit() +
18 +
19 - def reset(self): +
20 """ +21 Reset this objects state to the state that it was created with. +22 """ +23 memento = self.memento +24 self.rollback(deepcopy(memento)) +25 self.memento = memento +
26 +27 +
28 -class Pool(object): +
29 """ +30 An Object Pool design pattern implementation. +31 +32 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage} +33 - External Object Pool Pattern documentation: U{https://en.wikipedia.org/wiki/Object_pool_pattern} +34 """ +
35 - def __init__(self, reusable_class, *args, **kwargs): +
36 """ +37 Initialize a new object pool instance. +38 +39 @param reusable_class: The reusable class this object pool is responsible for. +40 @param args: args for reusable object creation. +41 @param kwargs: kwargs for reusable object creation. +42 """ +43 self.reusables = list() +44 self.reusable_class = reusable_class +45 self.args = args +46 self.kwargs = kwargs +47 self.pool_size = 2 +48 self._expand(self.pool_size) +
49 +
50 - def acquire(self): +
51 """ +52 Acquire an object from the pool. +53 +54 @return: An object from the pool. +55 """ +56 try: +57 reusable = self.reusables.pop() +58 except IndexError: +59 self._expand(self.pool_size) +60 reusable = self.reusables.pop() +61 +62 return reusable +
63 +
64 - def release(self, reusable): +
65 """ +66 Release an object back into the pool. +67 +68 @param reusable: The object to return to the pool. +69 """ +70 reusable.reset() +71 self.reusables.append(reusable) +
72 +
73 - def _expand(self, size): +
74 for i in range(0, size): +75 self.reusables.append(self.reusable_class(*self.args, **self.kwargs)) +
76 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.pool.Pool-class.html b/html/pypat.creational.pool.Pool-class.html new file mode 100644 index 0000000..998e8ef --- /dev/null +++ b/html/pypat.creational.pool.Pool-class.html @@ -0,0 +1,351 @@ + + + + + pypat.creational.pool.Pool + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module pool :: + Class Pool + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Pool

source code

+
+object --+
+         |
+        Pool
+
+ +
+
+
+An Object Pool design pattern implementation.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
+- External Object Pool Pattern documentation: U{https://en.wikipedia.org/wiki/Object_pool_pattern}
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + reusable_class, + *args, + **kwargs)
+ Initialize a new object pool instance.
+ source code + +
+ +
+   + + + + + + +
acquire(self)
+ Acquire an object from the pool.
+ source code + +
+ +
+   + + + + + + +
release(self, + reusable)
+ Release an object back into the pool.
+ source code + +
+ +
+   + + + + + + +
_expand(self, + size) + source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + reusable_class, + *args, + **kwargs) +
(Constructor) +

+
source code  +
+ +

Initialize a new object pool instance.

+
+
Parameters:
+
    +
  • reusable_class - The reusable class this object pool is responsible for.
  • +
  • args - args for reusable object creation.
  • +
  • kwargs - kwargs for reusable object creation.
  • +
+
Overrides: + object.__init__ +
+
+
+
+ +
+ +
+ + +
+

acquire(self) +

+
source code  +
+ +

Acquire an object from the pool.

+
+
Returns:
+
An object from the pool.
+
+
+
+ +
+ +
+ + +
+

release(self, + reusable) +

+
source code  +
+ +

Release an object back into the pool.

+
+
Parameters:
+
    +
  • reusable - The object to return to the pool.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.pool.Reusable-class.html b/html/pypat.creational.pool.Reusable-class.html new file mode 100644 index 0000000..022671f --- /dev/null +++ b/html/pypat.creational.pool.Reusable-class.html @@ -0,0 +1,167 @@ + + + + + pypat.creational.pool.Reusable + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module pool :: + Class Reusable + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Reusable

source code

+
+
+An abstract reusable class.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
+- External Object Pool Pattern documentation: U{https://en.wikipedia.org/wiki/Object_pool_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self)
+ Initialize a new Reusable instance.
+ source code + +
+ +
+   + + + + + + +
reset(self)
+ Reset this objects state to the state that it was created with.
+ source code + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.prototype-module.html b/html/pypat.creational.prototype-module.html new file mode 100644 index 0000000..f829a85 --- /dev/null +++ b/html/pypat.creational.prototype-module.html @@ -0,0 +1,156 @@ + + + + + pypat.creational.prototype + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module prototype + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module prototype

source code

+ + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Prototype
+ Prototype design pattern abstract class. +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = 'pypat.creational' +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.prototype-pysrc.html b/html/pypat.creational.prototype-pysrc.html new file mode 100644 index 0000000..8c338e3 --- /dev/null +++ b/html/pypat.creational.prototype-pysrc.html @@ -0,0 +1,138 @@ + + + + + pypat.creational.prototype + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module prototype + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.creational.prototype

+
+ 1  from copy import deepcopy 
+ 2  from types import MethodType 
+ 3   
+ 4   
+
5 -class Prototype(object): +
6 """ + 7 Prototype design pattern abstract class. + 8 + 9 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage} +10 - External Prototype Pattern documentation: U{https://en.wikipedia.org/wiki/Prototype_pattern} +11 """ +
12 - def prototype(self, **attributes): +
13 """ +14 Copy the prototype this object and optionally update attributes. +15 +16 @param attributes: Keyword arguments of any attributes you wish to update. +17 @return: A copy of this object with the updated attributes. +18 """ +19 obj = deepcopy(self) +20 for attribute in attributes: +21 if callable(attributes[attribute]): +22 setattr(obj, attribute, MethodType(attributes[attribute], obj)) +23 else: +24 setattr(obj, attribute, attributes[attribute]) +25 +26 return obj +
27 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.prototype.Prototype-class.html b/html/pypat.creational.prototype.Prototype-class.html new file mode 100644 index 0000000..88537e6 --- /dev/null +++ b/html/pypat.creational.prototype.Prototype-class.html @@ -0,0 +1,247 @@ + + + + + pypat.creational.prototype.Prototype + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module prototype :: + Class Prototype + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Prototype

source code

+
+object --+
+         |
+        Prototype
+
+ +
+
+
+Prototype design pattern abstract class.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
+- External Prototype Pattern documentation: U{https://en.wikipedia.org/wiki/Prototype_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
prototype(self, + **attributes)
+ Copy the prototype this object and optionally update attributes.
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __init__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

prototype(self, + **attributes) +

+
source code  +
+ +

Copy the prototype this object and optionally update attributes.

+
+
Parameters:
+
    +
  • attributes - Keyword arguments of any attributes you wish to update.
  • +
+
Returns:
+
A copy of this object with the updated attributes.
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.singleton-module.html b/html/pypat.creational.singleton-module.html new file mode 100644 index 0000000..deb543d --- /dev/null +++ b/html/pypat.creational.singleton-module.html @@ -0,0 +1,156 @@ + + + + + pypat.creational.singleton + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module singleton + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module singleton

source code

+ + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Singleton
+ Singleton Metaclass. +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.singleton-pysrc.html b/html/pypat.creational.singleton-pysrc.html new file mode 100644 index 0000000..f15827c --- /dev/null +++ b/html/pypat.creational.singleton-pysrc.html @@ -0,0 +1,136 @@ + + + + + pypat.creational.singleton + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module singleton + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.creational.singleton

+
+
1 -class Singleton(type): +
2 """ + 3 Singleton Metaclass. + 4 + 5 Enforces any object using this metaclass to only create a single instance. + 6 + 7 - External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage} + 8 - External Singleton Pattern documentation: U{https://en.wikipedia.org/wiki/Singleton_pattern} + 9 """ +10 __instance = None +11 +
12 - def __call__(cls, *args, **kwargs): +
13 """ +14 Override the __call__ method to make sure only one instance is created. +15 """ +16 if cls.__instance is None: +17 cls.__instance = type.__call__(cls, *args, **kwargs) +18 +19 return cls.__instance +
20 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.creational.singleton.Singleton-class.html b/html/pypat.creational.singleton.Singleton-class.html new file mode 100644 index 0000000..fe78852 --- /dev/null +++ b/html/pypat.creational.singleton.Singleton-class.html @@ -0,0 +1,302 @@ + + + + + pypat.creational.singleton.Singleton + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package creational :: + Module singleton :: + Class Singleton + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Type Singleton

source code

+
+object --+    
+         |    
+      type --+
+             |
+            Singleton
+
+ +
+
+
+Singleton Metaclass.
+
+Enforces any object using this metaclass to only create a single instance.
+
+- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
+- External Singleton Pattern documentation: U{https://en.wikipedia.org/wiki/Singleton_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__call__(cls, + *args, + **kwargs)
+ Override the __call__ method to make sure only one instance is + created.
+ source code + +
+ +
+

Inherited from type: + __delattr__, + __eq__, + __ge__, + __getattribute__, + __gt__, + __hash__, + __init__, + __instancecheck__, + __le__, + __lt__, + __ne__, + __new__, + __repr__, + __setattr__, + __subclasscheck__, + __subclasses__, + mro +

+

Inherited from object: + __format__, + __reduce__, + __reduce_ex__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Class Variables[hide private]
+
+   + + __instance = None +
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from type: + __abstractmethods__, + __base__, + __bases__, + __basicsize__, + __dictoffset__, + __flags__, + __itemsize__, + __mro__, + __name__, + __weakrefoffset__ +

+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__call__(cls, + *args, + **kwargs) +
(Call operator) +

+
source code  +
+ +

Override the __call__ method to make sure only one instance is + created.

+
+
Overrides: + type.__call__ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural-module.html b/html/pypat.structural-module.html new file mode 100644 index 0000000..972e713 --- /dev/null +++ b/html/pypat.structural-module.html @@ -0,0 +1,156 @@ + + + + + pypat.structural + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Package structural

source code

+ + + + + + + +
+ + + + + +
Submodules[hide private]
+
+
+ +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural-pysrc.html b/html/pypat.structural-pysrc.html new file mode 100644 index 0000000..a643d67 --- /dev/null +++ b/html/pypat.structural-pysrc.html @@ -0,0 +1,112 @@ + + + + + pypat.structural + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Package pypat.structural

+
+1   
+2   
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.adapter-module.html b/html/pypat.structural.adapter-module.html new file mode 100644 index 0000000..fc4bf4a --- /dev/null +++ b/html/pypat.structural.adapter-module.html @@ -0,0 +1,156 @@ + + + + + pypat.structural.adapter + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module adapter + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module adapter

source code

+ + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Adapter
+ Adapter class as part of the Adapter design pattern. +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.adapter-pysrc.html b/html/pypat.structural.adapter-pysrc.html new file mode 100644 index 0000000..99f81de --- /dev/null +++ b/html/pypat.structural.adapter-pysrc.html @@ -0,0 +1,145 @@ + + + + + pypat.structural.adapter + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module adapter + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.structural.adapter

+
+
1 -class Adapter(object): +
2 """ + 3 Adapter class as part of the Adapter design pattern. + 4 + 5 - External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage} + 6 - External Adapter Pattern Documentation: U{https://en.wikipedia.org/wiki/Adapter_pattern} + 7 """ +
8 - def __init__(self, adaptee, **adapted_methods): +
9 """ +10 Initialize a new adapter instance. +11 +12 @param adaptee: The object to adapt to a new interface. +13 @type adaptee: Object +14 @param adapted_methods: A dictionary of methods to adapt. +15 @type adapted_methods: dict +16 """ +17 self.__adaptee = adaptee +18 self.__dict__.update({k: v for k, v in adapted_methods.items() if callable(v) and +19 getattr(self.__adaptee, v.__name__, None)}) +
20 +
21 - def __getattr__(self, attr): +
22 """ +23 All non-adapted calls are passed to the adaptee. +24 +25 @param attr: The attribute to get from the adaptee. +26 """ +27 return getattr(self.__adaptee, attr) +
28 +
29 - def original_dict(self): +
30 """ +31 Get the adaptee's __dict__ +32 """ +33 return self.__adaptee.__dict__ +
34 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.adapter.Adapter-class.html b/html/pypat.structural.adapter.Adapter-class.html new file mode 100644 index 0000000..618e568 --- /dev/null +++ b/html/pypat.structural.adapter.Adapter-class.html @@ -0,0 +1,311 @@ + + + + + pypat.structural.adapter.Adapter + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module adapter :: + Class Adapter + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Adapter

source code

+
+object --+
+         |
+        Adapter
+
+ +
+
+
+Adapter class as part of the Adapter design pattern.
+
+- External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage}
+- External Adapter Pattern Documentation: U{https://en.wikipedia.org/wiki/Adapter_pattern}
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + adaptee, + **adapted_methods)
+ Initialize a new adapter instance.
+ source code + +
+ +
+   + + + + + + +
__getattr__(self, + attr)
+ All non-adapted calls are passed to the adaptee.
+ source code + +
+ +
+   + + + + + + +
original_dict(self)
+ Get the adaptee's __dict__
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + adaptee, + **adapted_methods) +
(Constructor) +

+
source code  +
+ +

Initialize a new adapter instance.

+
+
Parameters:
+
    +
  • adaptee (Object) - The object to adapt to a new interface.
  • +
  • adapted_methods (dict) - A dictionary of methods to adapt.
  • +
+
Overrides: + object.__init__ +
+
+
+
+ +
+ +
+ + +
+

__getattr__(self, + attr) +
(Qualification operator) +

+
source code  +
+ +

All non-adapted calls are passed to the adaptee.

+
+
Parameters:
+
    +
  • attr - The attribute to get from the adaptee.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.composite-module.html b/html/pypat.structural.composite-module.html new file mode 100644 index 0000000..20599c1 --- /dev/null +++ b/html/pypat.structural.composite-module.html @@ -0,0 +1,156 @@ + + + + + pypat.structural.composite + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module composite + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module composite

source code

+ + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Composite
+ Composite class as part of the Composite pattern. +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.composite-pysrc.html b/html/pypat.structural.composite-pysrc.html new file mode 100644 index 0000000..b155b10 --- /dev/null +++ b/html/pypat.structural.composite-pysrc.html @@ -0,0 +1,185 @@ + + + + + pypat.structural.composite + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module composite + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.structural.composite

+
+
1 -class Composite(object): +
2 """ + 3 Composite class as part of the Composite pattern. + 4 + 5 - External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage} + 6 - External Composite Pattern documentation: U{https://en.wikipedia.org/wiki/Composite_pattern} + 7 """ +
8 - def __init__(self, interface): +
9 """ +10 Initialize a new Composite instance. +11 +12 @param interface: The interface the all child components must adhere to when added to this composite. +13 @type interface: class +14 """ +15 self.components = set() +16 self.interface = interface +
17 +
18 - def add_component(self, component): +
19 """ +20 Add a component to this composite. +21 +22 @param component: The component to add to this Composite +23 @raise AttributeError: If the component does not adhere to this Composites interface. +24 """ +25 valid = False +26 try: +27 if component.interface == self.interface: +28 valid = True +29 except AttributeError: +30 if self.interface in component.__class__.__mro__: +31 valid = True +32 finally: +33 if valid: +34 self.components.add(component) +35 else: +36 raise AttributeError('Component {0} does not follow this composites interface {1}'.format( +37 component.__class__, self.interface)) +
38 +
39 - def remove_component(self, component): +
40 """ +41 Remove a component from this composite. +42 +43 @param component: The component to remove from this Composite. +44 """ +45 try: +46 self.components.remove(component) +47 except KeyError: +48 pass +
49 +
50 - def _delegate(self, func_name): +
51 """ +52 Apply a function to all child components by function name. +53 +54 @param func_name: The name of the function to call with all child components. +55 @type func_name: str +56 @raise AttributeError: If a child component does not have a callable function with the given name. +57 """ +58 for component in self.components: +59 attribute = getattr(component, func_name) +60 if callable(attribute): +61 attribute() +62 else: +63 raise AttributeError() +
64 +
65 - def __getattr__(self, item): +
66 """ +67 Override getattr to delegate all function calls to children. +68 +69 @param item: The function to call with this composites children components. +70 @type item: str +71 @return: A function that when called will call all child functions with the given function name. +72 """ +73 return lambda: self._delegate(item) +
74 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.composite.Composite-class.html b/html/pypat.structural.composite.Composite-class.html new file mode 100644 index 0000000..4d81866 --- /dev/null +++ b/html/pypat.structural.composite.Composite-class.html @@ -0,0 +1,430 @@ + + + + + pypat.structural.composite.Composite + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module composite :: + Class Composite + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Composite

source code

+
+object --+
+         |
+        Composite
+
+ +
+
+
+Composite class as part of the Composite pattern.
+
+- External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage}
+- External Composite Pattern documentation: U{https://en.wikipedia.org/wiki/Composite_pattern}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + interface)
+ Initialize a new Composite instance.
+ source code + +
+ +
+   + + + + + + +
add_component(self, + component)
+ Add a component to this composite.
+ source code + +
+ +
+   + + + + + + +
remove_component(self, + component)
+ Remove a component from this composite.
+ source code + +
+ +
+   + + + + + + +
_delegate(self, + func_name)
+ Apply a function to all child components by function name.
+ source code + +
+ +
+   + + + + + + +
__getattr__(self, + item)
+ Override getattr to delegate all function calls to children.
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + interface) +
(Constructor) +

+
source code  +
+ +

Initialize a new Composite instance.

+
+
Parameters:
+
    +
  • interface (class) - The interface the all child components must adhere to when added + to this composite.
  • +
+
Overrides: + object.__init__ +
+
+
+
+ +
+ +
+ + +
+

add_component(self, + component) +

+
source code  +
+ +

Add a component to this composite.

+
+
Parameters:
+
    +
  • component - The component to add to this Composite
  • +
+
Raises:
+
    +
  • AttributeError - If the component does not adhere to this Composites interface.
  • +
+
+
+
+ +
+ +
+ + +
+

remove_component(self, + component) +

+
source code  +
+ +

Remove a component from this composite.

+
+
Parameters:
+
    +
  • component - The component to remove from this Composite.
  • +
+
+
+
+ +
+ +
+ + +
+

_delegate(self, + func_name) +

+
source code  +
+ +

Apply a function to all child components by function name.

+
+
Parameters:
+
    +
  • func_name (str) - The name of the function to call with all child components.
  • +
+
Raises:
+
    +
  • AttributeError - If a child component does not have a callable function with the + given name.
  • +
+
+
+
+ +
+ +
+ + +
+

__getattr__(self, + item) +
(Qualification operator) +

+
source code  +
+ +

Override getattr to delegate all function calls to children.

+
+
Parameters:
+
    +
  • item (str) - The function to call with this composites children components.
  • +
+
Returns:
+
A function that when called will call all child functions with + the given function name.
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.decorator-module.html b/html/pypat.structural.decorator-module.html new file mode 100644 index 0000000..f207ccc --- /dev/null +++ b/html/pypat.structural.decorator-module.html @@ -0,0 +1,155 @@ + + + + + pypat.structural.decorator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module decorator + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module decorator

source code

+ + + + + + + + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + Decorator
+ Base Decorator class that all decorator classes inherit from. +
+   + + DecoratorSimple
+ A Base Decorator class for decorators with no arguments. +
+   + + DecoratorComplex
+ A Base Decorator class for decorators with arguments. +
+   + + CallWrapper
+ A Decorator for wrapping DecoratorComplex __call__ methods. +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.decorator-pysrc.html b/html/pypat.structural.decorator-pysrc.html new file mode 100644 index 0000000..010aef2 --- /dev/null +++ b/html/pypat.structural.decorator-pysrc.html @@ -0,0 +1,203 @@ + + + + + pypat.structural.decorator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module decorator + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.structural.decorator

+
+ 1  from functools import partial 
+ 2  from abc import ABCMeta, abstractmethod 
+
3 + 4 + 5 -class Decorator(object, metaclass=ABCMeta): +
6 """ + 7 Base Decorator class that all decorator classes inherit from. + 8 + 9 - External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage} +10 - External Decorator Pattern documentation: U{https://en.wikipedia.org/wiki/Decorator_pattern} +11 """ +
12 - def __get__(self, instance, owner): +
13 """ +14 Override __get__ in order to get the instance of a bound of method call. +15 """ +16 return partial(self.__call__, instance) +
17 +18 @abstractmethod +
19 - def __call__(self, *args, **kwargs): +
20 """ +21 All decorators must implement a __call__ method. +22 """ +23 pass +
24 +
25 +26 -class DecoratorSimple(Decorator, metaclass=ABCMeta): +
27 """ +28 A Base Decorator class for decorators with no arguments. +29 +30 - External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage} +31 - External Decorator Pattern documentation: U{https://en.wikipedia.org/wiki/Decorator_pattern} +32 """ +
33 - def __init__(self, func): +
34 """ +35 Initialize a new DecoratorSimple instance. +36 +37 @param func: The function being decorated. +38 """ +39 self.func = func +
40 +
41 +42 -class DecoratorComplex(Decorator, metaclass=ABCMeta): +
43 """ +44 A Base Decorator class for decorators with arguments. +45 +46 - External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage} +47 - External Decorator Pattern documentation: U{https://en.wikipedia.org/wiki/Decorator_pattern} +48 """ +49 @abstractmethod +
50 - def __init__(self, *args, **kwargs): +
51 """ +52 Initialize a new DecoratorComplex instance. +53 +54 @param args: Args for the decorator. +55 @param kwargs: Keyword args for the decorator. +56 """ +57 pass +
58 +59 @abstractmethod +
60 - def __call__(self, func, *args, **kwargs): +
61 """ +62 Concrete DecoratorComplex instances must override the __call__ method. +63 +64 @param func: The function being decorated. +65 @param args: Arguments for the decorated function. +66 @param kwargs: Keyword arguments for the decorated function. +67 @return: +68 """ +69 pass +
70 +
71 +72 -class CallWrapper(DecoratorSimple): +
73 """ +74 A Decorator for wrapping DecoratorComplex __call__ methods. +75 +76 - External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage} +77 - External Decorator Pattern documentation: U{https://en.wikipedia.org/wiki/Decorator_pattern} +78 """ +
79 - def __call__(self, instance, func): +
80 """ +81 Wrap a concrete DecoratorComplex __call__ method. +82 """ +83 def wrapped(*args, **kwargs): +84 return self.func(instance, func, *args, **kwargs) +
85 +86 return wrapped +
87 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.decorator.CallWrapper-class.html b/html/pypat.structural.decorator.CallWrapper-class.html new file mode 100644 index 0000000..0f0b7a8 --- /dev/null +++ b/html/pypat.structural.decorator.CallWrapper-class.html @@ -0,0 +1,166 @@ + + + + + pypat.structural.decorator.CallWrapper + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module decorator :: + Class CallWrapper + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class CallWrapper

source code

+
+DecoratorSimple --+
+                  |
+                 CallWrapper
+
+ +
+
+
+A Decorator for wrapping DecoratorComplex __call__ methods.
+
+- External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage}
+- External Decorator Pattern documentation: U{https://en.wikipedia.org/wiki/Decorator_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__call__(self, + instance, + func)
+ Wrap a concrete DecoratorComplex __call__ method.
+ source code + +
+ +
+

Inherited from DecoratorSimple: + __init__ +

+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.decorator.Decorator-class.html b/html/pypat.structural.decorator.Decorator-class.html new file mode 100644 index 0000000..ea82f8b --- /dev/null +++ b/html/pypat.structural.decorator.Decorator-class.html @@ -0,0 +1,217 @@ + + + + + pypat.structural.decorator.Decorator + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module decorator :: + Class Decorator + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Decorator

source code

+
+
+Base Decorator class that all decorator classes inherit from.
+
+- External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage}
+- External Decorator Pattern documentation: U{https://en.wikipedia.org/wiki/Decorator_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__get__(self, + instance, + owner)
+ Override __get__ in order to get the instance of a bound of method + call.
+ source code + +
+ +
+   + + + + + + +
__call__(self, + *args, + **kwargs)
+ All decorators must implement a __call__ method.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__call__(self, + *args, + **kwargs) +
(Call operator) +

+
source code  +
+ +

All decorators must implement a __call__ method.

+
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.decorator.DecoratorComplex-class.html b/html/pypat.structural.decorator.DecoratorComplex-class.html new file mode 100644 index 0000000..658569e --- /dev/null +++ b/html/pypat.structural.decorator.DecoratorComplex-class.html @@ -0,0 +1,257 @@ + + + + + pypat.structural.decorator.DecoratorComplex + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module decorator :: + Class DecoratorComplex + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class DecoratorComplex

source code

+
+
+A Base Decorator class for decorators with arguments.
+
+- External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage}
+- External Decorator Pattern documentation: U{https://en.wikipedia.org/wiki/Decorator_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + *args, + **kwargs)
+ Initialize a new DecoratorComplex instance.
+ source code + +
+ +
+   + + + + + + +
__call__(self, + func, + *args, + **kwargs)
+ Concrete DecoratorComplex instances must override the __call__ + method.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + *args, + **kwargs) +
(Constructor) +

+
source code  +
+ +

Initialize a new DecoratorComplex instance.

+
+
Parameters:
+
    +
  • args - Args for the decorator.
  • +
  • kwargs - Keyword args for the decorator.
  • +
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+ +
+ +
+ + +
+

__call__(self, + func, + *args, + **kwargs) +
(Call operator) +

+
source code  +
+ +

Concrete DecoratorComplex instances must override the __call__ + method.

+
+
Parameters:
+
    +
  • func - The function being decorated.
  • +
  • args - Arguments for the decorated function.
  • +
  • kwargs - Keyword arguments for the decorated function.
  • +
+
Decorators:
+
    +
  • @abstractmethod
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.decorator.DecoratorSimple-class.html b/html/pypat.structural.decorator.DecoratorSimple-class.html new file mode 100644 index 0000000..d8f9859 --- /dev/null +++ b/html/pypat.structural.decorator.DecoratorSimple-class.html @@ -0,0 +1,195 @@ + + + + + pypat.structural.decorator.DecoratorSimple + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module decorator :: + Class DecoratorSimple + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class DecoratorSimple

source code

+
+
+A Base Decorator class for decorators with no arguments.
+
+- External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage}
+- External Decorator Pattern documentation: U{https://en.wikipedia.org/wiki/Decorator_pattern}
+
+
+ + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + func)
+ Initialize a new DecoratorSimple instance.
+ source code + +
+ +
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + func) +
(Constructor) +

+
source code  +
+ +

Initialize a new DecoratorSimple instance.

+
+
Parameters:
+
    +
  • func - The function being decorated.
  • +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.flyweight-module.html b/html/pypat.structural.flyweight-module.html new file mode 100644 index 0000000..f0e3da3 --- /dev/null +++ b/html/pypat.structural.flyweight-module.html @@ -0,0 +1,156 @@ + + + + + pypat.structural.flyweight + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module flyweight + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module flyweight

source code

+ + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + FlyweightMeta
+ Flyweight meta class as part of the Flyweight design pattern. +
+ + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.flyweight-pysrc.html b/html/pypat.structural.flyweight-pysrc.html new file mode 100644 index 0000000..e318fd9 --- /dev/null +++ b/html/pypat.structural.flyweight-pysrc.html @@ -0,0 +1,165 @@ + + + + + pypat.structural.flyweight + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module flyweight + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module pypat.structural.flyweight

+
+
1 -class FlyweightMeta(type): +
2 """ + 3 Flyweight meta class as part of the Flyweight design pattern. + 4 + 5 - External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage} + 6 - External Flyweight Pattern documentation: U{https://en.wikipedia.org/wiki/Flyweight_pattern} + 7 """ +
8 - def __new__(mcs, name, bases, attrs): +
9 """ +10 Override class construction to add 'pool' attribute to classes dict. +11 +12 @param name: The name of the class. +13 @param bases: Base classes of the class. +14 @param attrs: Attributes of the class. +15 @return: A new Class. +16 """ +17 attrs['pool'] = dict() +18 return super(FlyweightMeta, mcs).__new__(mcs, name, bases, attrs) +
19 +20 @staticmethod +
21 - def _serialize(cls, *args, **kwargs): +
22 """ +23 Serialize arguments to a string representation. +24 """ +25 serialized_args = [str(arg) for arg in args] +26 serialized_kwargs = [str(kwargs), cls.__name__] +27 +28 serialized_args.extend(serialized_kwargs) +29 +30 return ''.join(serialized_args) +
31 +
32 - def __call__(cls, *args, **kwargs): +
33 """ +34 Override call to use objects from a pool if identical parameters are used for object creation. +35 +36 @param args: Arguments for class instantiation. +37 @param kwargs: Keyword arguments for class instantiation. +38 @return: A new instance of the class. +39 """ +40 key = FlyweightMeta._serialize(cls, *args, **kwargs) +41 pool = getattr(cls, 'pool', {}) +42 +43 instance = pool.get(key) +44 if not instance: +45 instance = super(FlyweightMeta, cls).__call__(*args, **kwargs) +46 pool[key] = instance +47 +48 return instance +
49 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/pypat.structural.flyweight.FlyweightMeta-class.html b/html/pypat.structural.flyweight.FlyweightMeta-class.html new file mode 100644 index 0000000..7284a6b --- /dev/null +++ b/html/pypat.structural.flyweight.FlyweightMeta-class.html @@ -0,0 +1,373 @@ + + + + + pypat.structural.flyweight.FlyweightMeta + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package pypat :: + Package structural :: + Module flyweight :: + Class FlyweightMeta + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Type FlyweightMeta

source code

+
+object --+    
+         |    
+      type --+
+             |
+            FlyweightMeta
+
+ +
+
+
+Flyweight meta class as part of the Flyweight design pattern.
+
+- External Usage Documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Structural-Pattern-Usage}
+- External Flyweight Pattern documentation: U{https://en.wikipedia.org/wiki/Flyweight_pattern}
+
+
+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__call__(cls, + *args, + **kwargs)
+ Override call to use objects from a pool if identical parameters are + used for object creation.
+ source code + +
+ +
+

Inherited from type: + __delattr__, + __eq__, + __ge__, + __getattribute__, + __gt__, + __hash__, + __init__, + __instancecheck__, + __le__, + __lt__, + __ne__, + __repr__, + __setattr__, + __subclasscheck__, + __subclasses__, + mro +

+

Inherited from object: + __format__, + __reduce__, + __reduce_ex__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + + + + +
+ + + + + +
Static Methods[hide private]
+
+ a new object with type S, a subtype of T + + + + + + +
__new__(mcs, + name, + bases, + attrs)
+ Override class construction to add 'pool' attribute to classes dict.
+ source code + +
+ +
+   + + + + + + +
_serialize(cls, + *args, + **kwargs)
+ Serialize arguments to a string representation.
+ source code + +
+ +
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from type: + __abstractmethods__, + __base__, + __bases__, + __basicsize__, + __dictoffset__, + __flags__, + __itemsize__, + __mro__, + __name__, + __weakrefoffset__ +

+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__new__(mcs, + name, + bases, + attrs) +
Static Method +

+
source code  +
+ +

Override class construction to add 'pool' attribute to classes + dict.

+
+
Parameters:
+
    +
  • name - The name of the class.
  • +
  • bases - Base classes of the class.
  • +
  • attrs - Attributes of the class.
  • +
+
Returns: a new object with type S, a subtype of T
+
A new Class.
+
Overrides: + object.__new__ +
+
+
+
+ +
+ +
+ + +
+

__call__(cls, + *args, + **kwargs) +
(Call operator) +

+
source code  +
+ +

Override call to use objects from a pool if identical parameters are + used for object creation.

+
+
Parameters:
+
    +
  • args - Arguments for class instantiation.
  • +
  • kwargs - Keyword arguments for class instantiation.
  • +
+
Returns:
+
A new instance of the class.
+
Overrides: + type.__call__ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/redirect.html b/html/redirect.html new file mode 100644 index 0000000..913e5fd --- /dev/null +++ b/html/redirect.html @@ -0,0 +1,38 @@ +Epydoc Redirect Page + + + + + + + + +

Epydoc Auto-redirect page

+ +

When javascript is enabled, this page will redirect URLs of +the form redirect.html#dotted.name to the +documentation for the object with the given fully-qualified +dotted name.

+

 

+ + + + + diff --git a/html/toc-everything.html b/html/toc-everything.html new file mode 100644 index 0000000..fb0ea17 --- /dev/null +++ b/html/toc-everything.html @@ -0,0 +1,73 @@ + + + + + Everything + + + + + +

Everything

+
+

All Classes

+ pypat.behavioral.chain.Chain
pypat.behavioral.chain.ChainLink
pypat.behavioral.command.Command
pypat.behavioral.command.Invoker
pypat.behavioral.command.Receiver
pypat.behavioral.iterator.Iterable
pypat.behavioral.iterator.Iterator
pypat.behavioral.mediator.Mediator
pypat.behavioral.memento.Memento
pypat.behavioral.memento.Originator
pypat.behavioral.null.Null
pypat.behavioral.observer.Observable
pypat.behavioral.observer.Observer
pypat.behavioral.visitor.Visitee
pypat.behavioral.visitor.Visitor
pypat.creational.builder.Builder
pypat.creational.builder.Director
pypat.creational.factory.AbstractFactory
pypat.creational.factory.Factory
pypat.creational.pool.Pool
pypat.creational.pool.Reusable
pypat.creational.prototype.Prototype
pypat.creational.singleton.Singleton
pypat.structural.adapter.Adapter
pypat.structural.composite.Composite
pypat.structural.decorator.CallWrapper
pypat.structural.decorator.Decorator
pypat.structural.decorator.DecoratorComplex
pypat.structural.decorator.DecoratorSimple
pypat.structural.flyweight.FlyweightMeta

All Variables

+ pypat.__package__
pypat.behavioral.__package__
pypat.behavioral.mediator.__package__
pypat.behavioral.memento.__package__
pypat.behavioral.null.__package__
pypat.creational.__package__
pypat.creational.prototype.__package__
pypat.creational.singleton.__package__
pypat.structural.__package__
pypat.structural.adapter.__package__
pypat.structural.composite.__package__
pypat.structural.flyweight.__package__

+[hide private] + + + + diff --git a/html/toc-pypat-module.html b/html/toc-pypat-module.html new file mode 100644 index 0000000..f7078b6 --- /dev/null +++ b/html/toc-pypat-module.html @@ -0,0 +1,31 @@ + + + + + pypat + + + + + +

Module pypat

+
+

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral-module.html b/html/toc-pypat.behavioral-module.html new file mode 100644 index 0000000..d81f9eb --- /dev/null +++ b/html/toc-pypat.behavioral-module.html @@ -0,0 +1,31 @@ + + + + + behavioral + + + + + +

Module behavioral

+
+

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral.chain-module.html b/html/toc-pypat.behavioral.chain-module.html new file mode 100644 index 0000000..0531bca --- /dev/null +++ b/html/toc-pypat.behavioral.chain-module.html @@ -0,0 +1,32 @@ + + + + + chain + + + + + +

Module chain

+
+

Classes

+ Chain
ChainLink

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral.command-module.html b/html/toc-pypat.behavioral.command-module.html new file mode 100644 index 0000000..dcd9b2f --- /dev/null +++ b/html/toc-pypat.behavioral.command-module.html @@ -0,0 +1,33 @@ + + + + + command + + + + + +

Module command

+
+

Classes

+ Command
Invoker
Receiver

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral.iterator-module.html b/html/toc-pypat.behavioral.iterator-module.html new file mode 100644 index 0000000..fec4ac5 --- /dev/null +++ b/html/toc-pypat.behavioral.iterator-module.html @@ -0,0 +1,32 @@ + + + + + iterator + + + + + +

Module iterator

+
+

Classes

+ Iterable
Iterator

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral.mediator-module.html b/html/toc-pypat.behavioral.mediator-module.html new file mode 100644 index 0000000..e3c9f8b --- /dev/null +++ b/html/toc-pypat.behavioral.mediator-module.html @@ -0,0 +1,33 @@ + + + + + mediator + + + + + +

Module mediator

+
+

Classes

+ Mediator

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral.memento-module.html b/html/toc-pypat.behavioral.memento-module.html new file mode 100644 index 0000000..a358daf --- /dev/null +++ b/html/toc-pypat.behavioral.memento-module.html @@ -0,0 +1,34 @@ + + + + + memento + + + + + +

Module memento

+
+

Classes

+ Memento
Originator

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral.null-module.html b/html/toc-pypat.behavioral.null-module.html new file mode 100644 index 0000000..03f3670 --- /dev/null +++ b/html/toc-pypat.behavioral.null-module.html @@ -0,0 +1,33 @@ + + + + + null + + + + + +

Module null

+
+

Classes

+ Null

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral.observer-module.html b/html/toc-pypat.behavioral.observer-module.html new file mode 100644 index 0000000..b2cc231 --- /dev/null +++ b/html/toc-pypat.behavioral.observer-module.html @@ -0,0 +1,32 @@ + + + + + observer + + + + + +

Module observer

+
+

Classes

+ Observable
Observer

+[hide private] + + + + diff --git a/html/toc-pypat.behavioral.visitor-module.html b/html/toc-pypat.behavioral.visitor-module.html new file mode 100644 index 0000000..ce38ed0 --- /dev/null +++ b/html/toc-pypat.behavioral.visitor-module.html @@ -0,0 +1,32 @@ + + + + + visitor + + + + + +

Module visitor

+
+

Classes

+ Visitee
Visitor

+[hide private] + + + + diff --git a/html/toc-pypat.creational-module.html b/html/toc-pypat.creational-module.html new file mode 100644 index 0000000..0ad1a9a --- /dev/null +++ b/html/toc-pypat.creational-module.html @@ -0,0 +1,31 @@ + + + + + creational + + + + + +

Module creational

+
+

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.creational.builder-module.html b/html/toc-pypat.creational.builder-module.html new file mode 100644 index 0000000..304f14d --- /dev/null +++ b/html/toc-pypat.creational.builder-module.html @@ -0,0 +1,32 @@ + + + + + builder + + + + + +

Module builder

+
+

Classes

+ Builder
Director

+[hide private] + + + + diff --git a/html/toc-pypat.creational.factory-module.html b/html/toc-pypat.creational.factory-module.html new file mode 100644 index 0000000..8aee672 --- /dev/null +++ b/html/toc-pypat.creational.factory-module.html @@ -0,0 +1,32 @@ + + + + + factory + + + + + +

Module factory

+
+

Classes

+ AbstractFactory
Factory

+[hide private] + + + + diff --git a/html/toc-pypat.creational.pool-module.html b/html/toc-pypat.creational.pool-module.html new file mode 100644 index 0000000..a9d697d --- /dev/null +++ b/html/toc-pypat.creational.pool-module.html @@ -0,0 +1,32 @@ + + + + + pool + + + + + +

Module pool

+
+

Classes

+ Pool
Reusable

+[hide private] + + + + diff --git a/html/toc-pypat.creational.prototype-module.html b/html/toc-pypat.creational.prototype-module.html new file mode 100644 index 0000000..8aad614 --- /dev/null +++ b/html/toc-pypat.creational.prototype-module.html @@ -0,0 +1,33 @@ + + + + + prototype + + + + + +

Module prototype

+
+

Classes

+ Prototype

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.creational.singleton-module.html b/html/toc-pypat.creational.singleton-module.html new file mode 100644 index 0000000..5d07310 --- /dev/null +++ b/html/toc-pypat.creational.singleton-module.html @@ -0,0 +1,33 @@ + + + + + singleton + + + + + +

Module singleton

+
+

Classes

+ Singleton

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.structural-module.html b/html/toc-pypat.structural-module.html new file mode 100644 index 0000000..292a482 --- /dev/null +++ b/html/toc-pypat.structural-module.html @@ -0,0 +1,31 @@ + + + + + structural + + + + + +

Module structural

+
+

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.structural.adapter-module.html b/html/toc-pypat.structural.adapter-module.html new file mode 100644 index 0000000..ce7a85b --- /dev/null +++ b/html/toc-pypat.structural.adapter-module.html @@ -0,0 +1,33 @@ + + + + + adapter + + + + + +

Module adapter

+
+

Classes

+ Adapter

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.structural.composite-module.html b/html/toc-pypat.structural.composite-module.html new file mode 100644 index 0000000..9ce5579 --- /dev/null +++ b/html/toc-pypat.structural.composite-module.html @@ -0,0 +1,33 @@ + + + + + composite + + + + + +

Module composite

+
+

Classes

+ Composite

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc-pypat.structural.decorator-module.html b/html/toc-pypat.structural.decorator-module.html new file mode 100644 index 0000000..de9aaf2 --- /dev/null +++ b/html/toc-pypat.structural.decorator-module.html @@ -0,0 +1,34 @@ + + + + + decorator + + + + + +

Module decorator

+
+

Classes

+ CallWrapper
Decorator
DecoratorComplex
DecoratorSimple

+[hide private] + + + + diff --git a/html/toc-pypat.structural.flyweight-module.html b/html/toc-pypat.structural.flyweight-module.html new file mode 100644 index 0000000..89e5296 --- /dev/null +++ b/html/toc-pypat.structural.flyweight-module.html @@ -0,0 +1,33 @@ + + + + + flyweight + + + + + +

Module flyweight

+
+

Classes

+ FlyweightMeta

Variables

+ __package__

+[hide private] + + + + diff --git a/html/toc.html b/html/toc.html new file mode 100644 index 0000000..12c7a0b --- /dev/null +++ b/html/toc.html @@ -0,0 +1,53 @@ + + + + + Table of Contents + + + + + +

Table of Contents

+
+ Everything +
+

Modules

+ pypat
pypat.behavioral
pypat.behavioral.chain
pypat.behavioral.command
pypat.behavioral.iterator
pypat.behavioral.mediator
pypat.behavioral.memento
pypat.behavioral.null
pypat.behavioral.observer
pypat.behavioral.visitor
pypat.creational
pypat.creational.builder
pypat.creational.factory
pypat.creational.pool
pypat.creational.prototype
pypat.creational.singleton
pypat.structural
pypat.structural.adapter
pypat.structural.composite
pypat.structural.decorator
pypat.structural.flyweight

+ [hide private] + + + +