Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions patterns/behavioral/catalog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
A class that uses different static function depending of a parameter passed in
init. Note the use of a single dictionary instead of multiple conditions
Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/chain_of_responsibility.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?

Expand Down
3 changes: 0 additions & 3 deletions patterns/behavioral/chaining_method.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python


class Person:
def __init__(self, name, action):
self.name = name
Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*TL;DR
Encapsulates all information needed to perform an action or trigger an event.
Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/iterator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
http://ginstrom.com/scribbles/2007/10/08/design-patterns-python-style/
Implementation of the iterator pattern with a generator
Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/mediator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
https://www.djangospin.com/design-patterns-python/mediator/

Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/memento.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
http://code.activestate.com/recipes/413838-memento-closure/

Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/observer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
http://code.activestate.com/recipes/131499-observer-pattern/

Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/publish_subscribe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
Reference:
http://www.slideshare.net/ishraqabd/publish-subscribe-model-overview-13368808
Expand Down
3 changes: 0 additions & 3 deletions patterns/behavioral/registry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python


class RegistryHolder(type):

REGISTRY = {}
Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/specification.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
@author: Gordeev Andrey <gordeev.and.and@gmail.com>

Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/state.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
Implementation of the state pattern

Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/strategy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?
Define a family of algorithms, encapsulate each one, and make them interchangeable.
Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/template.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
An example of the Template pattern in Python

Expand Down
2 changes: 0 additions & 2 deletions patterns/behavioral/visitor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
http://peter-hoffmann.com/2010/extrinsic-visitor-pattern-python-inheritance.html

Expand Down
2 changes: 0 additions & 2 deletions patterns/creational/abstract_factory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?

Expand Down
2 changes: 0 additions & 2 deletions patterns/creational/borg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?
The Borg pattern (also known as the Monostate pattern) is a way to
Expand Down
3 changes: 0 additions & 3 deletions patterns/creational/builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/python
# -*- coding : utf-8 -*-

"""
*What is this pattern about?
It decouples the creation of a complex object and its representation,
Expand Down
2 changes: 0 additions & 2 deletions patterns/creational/factory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""*What is this pattern about?
A Factory is an object for creating other objects.

Expand Down
2 changes: 0 additions & 2 deletions patterns/creational/lazy_evaluation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
Lazily-evaluated property pattern in Python.

Expand Down
2 changes: 0 additions & 2 deletions patterns/creational/pool.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?
This pattern is used when creating an object is costly (and they are
Expand Down
2 changes: 0 additions & 2 deletions patterns/creational/prototype.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?
This patterns aims to reduce the number of classes required by an
Expand Down
3 changes: 0 additions & 3 deletions patterns/dependency_injection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/python
# -*- coding : utf-8 -*-

"""
Dependency Injection (DI) is a technique whereby one object supplies the dependencies (services)
to another object (client).
Expand Down
2 changes: 0 additions & 2 deletions patterns/fundamental/delegation_pattern.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
Reference: https://en.wikipedia.org/wiki/Delegation_pattern
Author: https://github.com/IuryAlves
Expand Down
2 changes: 0 additions & 2 deletions patterns/other/blackboard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
@author: Eugene Duboviy <eugene.dubovoy@gmail.com> | github.com/duboviy

Expand Down
5 changes: 0 additions & 5 deletions patterns/other/graph_search.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#!/usr/bin/env python

""


class GraphSearch:

"""Graph search emulation in python, from source
Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/3-tier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*TL;DR
Separates presentation, application processing, and data management functions.
Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/adapter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?
The Adapter pattern provides a different interface for a class. We can
Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/bridge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*References:
http://en.wikibooks.org/wiki/Computer_Science_Design_Patterns/Bridge_Pattern#Python
Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/composite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?
The composite pattern describes a group of objects that is treated the
Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/decorator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?
The Decorator pattern is used to dynamically add a new feature to an
Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/facade.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
Example from https://en.wikipedia.org/wiki/Facade_pattern#Python

Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/flyweight.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*What is this pattern about?
This pattern aims to minimise the number of objects that are needed by
Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/front_controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
@author: Gordeev Andrey <gordeev.and.and@gmail.com>

Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/mvc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*TL;DR
Separates data in GUIs from the ways it is presented, and accepted.
Expand Down
2 changes: 0 additions & 2 deletions patterns/structural/proxy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
*TL;DR
Provides an interface to resource that is expensive to duplicate.
Expand Down
22 changes: 0 additions & 22 deletions run_all.sh

This file was deleted.

2 changes: 0 additions & 2 deletions tests/behavioral/test_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import unittest
Expand Down
2 changes: 0 additions & 2 deletions tests/behavioral/test_observer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from unittest.mock import patch

Expand Down
2 changes: 0 additions & 2 deletions tests/behavioral/test_publish_subscribe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from unittest.mock import patch, call
from patterns.behavioral.publish_subscribe import Provider, Publisher, Subscriber
Expand Down
2 changes: 0 additions & 2 deletions tests/behavioral/test_state.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from patterns.behavioral.state import Radio

Expand Down
2 changes: 0 additions & 2 deletions tests/creational/test_abstract_factory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from unittest.mock import patch

Expand Down
2 changes: 0 additions & 2 deletions tests/creational/test_borg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from patterns.creational.borg import Borg, YourBorg

Expand Down
2 changes: 0 additions & 2 deletions tests/creational/test_builder.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from patterns.creational.builder import construct_building, House, Flat, ComplexHouse

Expand Down
2 changes: 0 additions & 2 deletions tests/creational/test_lazy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import unittest
from patterns.creational.lazy_evaluation import Person
Expand Down
2 changes: 0 additions & 2 deletions tests/creational/test_pool.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import queue

Expand Down
2 changes: 0 additions & 2 deletions tests/creational/test_prototype.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from patterns.creational.prototype import Prototype, PrototypeDispatcher

Expand Down
2 changes: 0 additions & 2 deletions tests/structural/test_adapter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from patterns.structural.adapter import Dog, Cat, Human, Car, Adapter

Expand Down
2 changes: 0 additions & 2 deletions tests/structural/test_bridge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from unittest.mock import patch

Expand Down
2 changes: 0 additions & 2 deletions tests/structural/test_decorator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from patterns.structural.decorator import TextTag, BoldWrapper, ItalicWrapper

Expand Down
2 changes: 0 additions & 2 deletions tests/structural/test_proxy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from time import time
import unittest
Expand Down
2 changes: 0 additions & 2 deletions tests/test_hsm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from unittest.mock import patch

Expand Down