Skip to content

Commit ba8afd7

Browse files
committed
added the state variable to borg and improved the README
1 parent 39c74d0 commit ba8afd7

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
python-patterns
22
===============
33

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

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

910
Current Patterns:
1011

‎append_output.sh‎

100644100755
File mode changed.

‎borg.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Borg:
77

88
def__init__(self):
99
self.__dict__=self.__shared_state
10+
self.state='Init'
1011

1112
def__str__(self):
1213
returnself.state
@@ -44,8 +45,8 @@ class YourBorg(Borg):
4445
# rm2: Running
4546
# rm1: Zombie
4647
# rm2: Zombie
47-
# rm1 id: 139825262601040
48-
# rm2 id: 139825262601104
49-
# rm1: Zombie
50-
# rm2: Zombie
51-
# rm3: Zombie
48+
# rm1 id: 140732837899224
49+
# rm2 id: 140732837899296
50+
# rm1: Init
51+
# rm2: Init
52+
# rm3: Init

0 commit comments

Comments
(0)