diff options
author | Chris Ball <cjb@laptop.org> | 2008-05-23 05:21:37 (GMT) |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2008-05-23 05:21:37 (GMT) |
commit | 9f852bb53d2ae1d8e02604c0c42673b0d9a3760a (patch) | |
tree | 782927a76b7659535d366891bd9e6bbb30c7d3c4 /activity.py | |
parent | 4e94dec1a4a7ee9f6b0a852d4399ce09cad4c0e2 (diff) |
Hack: Wait five seconds for the server to start.
Diffstat (limited to 'activity.py')
-rw-r--r-- | activity.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activity.py b/activity.py index 88670f0..c70ceea 100644 --- a/activity.py +++ b/activity.py @@ -20,6 +20,7 @@ import os import sys import signal import atexit +import time from sugar.activity import registry activity_info = registry.get_registry().get_activity('org.laptop.WebActivity') @@ -42,7 +43,10 @@ class WikipediaActivity(webactivity.WebActivity): os.chdir(os.environ['SUGAR_BUNDLE_PATH']) self.server_pid = os.spawnlp(os.P_NOWAIT, 'python', 'python', 'py/server.py', WIKIDB, HTTP_PORT) - + + # FIXME: Give ourselves five seconds to start the server. + time.sleep(5) + atexit.register(self.kill_server) handle.uri = 'http://localhost:%s%s' % (HTTP_PORT, HOME_PAGE) |