Skip to content

Commit

Permalink
added the state variable to borg and improved the README
Browse files Browse the repository at this point in the history
  • Loading branch information
faif committed May 5, 2014
1 parent 39c74d0 commit ba8afd7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
python-patterns
===============

A collection of design patterns implemented (by other people) in python.
A collection of design patterns and idioms in Python.

When an implementation is added or modified, be sure to update this file and
rerun `append_output.sh` to keep the output comments at the bottom up to date.
rerun `append_output.sh` (eg. ./append_output.sh borg.py) to keep the output
comments at the bottom up to date.

Current Patterns:

Expand Down
Empty file modified append_output.sh
100644 → 100755
Empty file.
11 changes: 6 additions & 5 deletions borg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Borg:

def __init__(self):
self.__dict__ = self.__shared_state
self.state = 'Init'

def __str__(self):
return self.state
Expand Down Expand Up @@ -44,8 +45,8 @@ class YourBorg(Borg):
# rm2: Running
# rm1: Zombie
# rm2: Zombie
# rm1 id: 139825262601040
# rm2 id: 139825262601104
# rm1: Zombie
# rm2: Zombie
# rm3: Zombie
# rm1 id: 140732837899224
# rm2 id: 140732837899296
# rm1: Init
# rm2: Init
# rm3: Init

0 comments on commit ba8afd7

Please sign in to comment.