File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change 55
66
77class 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
3128class 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
4135if __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
You can’t perform that action at this time.
0 commit comments