Skip to content

Commit ca277dd

Browse files
committed
Merge branch 'prokaktus-master'
2 parents 561a479 + 22fa3da commit ca277dd

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

proxy.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66

77
class SalesManager:
8-
def work(self):
9-
print("Sales Manager working...")
10-
118
def talk(self):
129
print("Sales Manager ready to talk")
1310

@@ -17,7 +14,7 @@ def __init__(self):
1714
self.busy = 'No'
1815
self.sales = None
1916

20-
def work(self):
17+
def talk(self):
2118
print("Proxy checking for Sales Manager availability")
2219
if self.busy == 'No':
2320
self.sales = SalesManager()
@@ -29,24 +26,21 @@ def work(self):
2926

3027

3128
class NoTalkProxy(Proxy):
32-
def __init__(self):
33-
Proxy.__init__(self)
34-
35-
def work(self):
29+
def talk(self):
3630
print("Proxy checking for Sales Manager availability")
3731
time.sleep(2)
3832
print("This Sales Manager will not talk to you whether he/she is busy or not")
3933

4034

4135
if __name__ == '__main__':
4236
p = Proxy()
43-
p.work()
37+
p.talk()
4438
p.busy = 'Yes'
45-
p.work()
39+
p.talk()
4640
p = NoTalkProxy()
47-
p.work()
41+
p.talk()
4842
p.busy = 'Yes'
49-
p.work()
43+
p.talk()
5044

5145
### OUTPUT ###
5246
# Proxy checking for Sales Manager availability

0 commit comments

Comments
 (0)