forked from AllenDowney/ThinkPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPopupServer.py
More file actions
26 lines (20 loc) · 754 Bytes
/
PopupServer.py
File metadata and controls
26 lines (20 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""This module is part of an exercise for
Think Python: an Introduction to Software Design
Copyright 2011 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import sys
from remote_object import RemoteObject
from PopupDemo import spawn_popup
class PopupServer(RemoteObject):
"""a PopupServer is a remote object that provides a method,
popup() that takes a message and displays it in a Popup"""
def popup(self, message, sender):
spawn_popup(message, sender)
def main(script, name='popup_downey', *args):
"""name is the name of the remote object"""
print 'Starting PopupServer %s...' % name
server = PopupServer(name)
server.requestLoop()
if __name__ == '__main__':
main(*sys.argv)