Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@laptop.org>2007-12-11 09:24:34 (GMT)
committer C. Scott Ananian <cscott@laptop.org>2007-12-11 09:24:34 (GMT)
commit9df72c5591aee015089a4e96f9403183262dcc01 (patch)
tree4a01e662068fe7977dbb4fd14e232fc7354863d4 /activity.py
parent90c54afd7ea81be376b078eb08b87e4f20e71dcf (diff)
Factor out a pippy library, which programs can use with 'import pippy'.
The pygame portion of the library uses 'best practices' to avoid eating up CPU, and pauses & suspends after 20 seconds of inactivity.
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/activity.py b/activity.py
index 868cc03..ec15a16 100644
--- a/activity.py
+++ b/activity.py
@@ -216,7 +216,13 @@ class PippyActivity(Activity):
file.write(line)
file.close()
- self._pid = self._vte.fork_command("/bin/sh", ["/bin/sh", "-c", "python /tmp/pippy.py; sleep 1"])
+ self._pid = self._vte.fork_command \
+ (command="/bin/sh",
+ argv=["/bin/sh", "-c",
+ "python /tmp/pippy.py; sleep 1"],
+ envv=["PYTHONPATH=%s/library" % get_bundle_path()],
+ directory=get_bundle_path(),
+ lastlog=False, utmp=False, wtmp=False)
def stopbutton_cb(self, button):
os.kill(self._pid, SIGTERM)