Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-12-21 14:18:54 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2012-12-21 14:18:54 (GMT)
commit9674738abc8984d15b55418e52718ac28669cc7d (patch)
treefe730b585a78280ece79488c5612698b8e89160b /activity.py
parenteff264857d005719f081eb9fea1e8b099670d395 (diff)
Activity completely ported to sugargame with no regressions
Signed-off-by: Daniel Francis <francis@sugarlabs.org>
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/activity.py b/activity.py
index 764470b..3a97890 100644
--- a/activity.py
+++ b/activity.py
@@ -37,8 +37,6 @@ except ImportError:
# <= 0.84 toolbars
pass
-import olpcgamesutil
-
class PhysicsActivity(activity.Activity):
def __init__(self, handle):
@@ -60,18 +58,10 @@ class PhysicsActivity(activity.Activity):
self._canvas.run_pygame(self.game.run)
def read_file(self, file_path):
- event = pygame.event.Event(pygame.USEREVENT)
- event.code = olpcgamesutil.FILE_READ_REQUEST
- event.filename = file_path
- event.metadata = self.metadata
- self._canvas.translator._post(event)
+ self.game.read_file(file_path)
def write_file(self, file_path):
- event = pygame.event.Event(pygame.USEREVENT,
- code = olpcgamesutil.FILE_WRITE_REQUEST,
- filename = file_path,
- metadata = self.metadata)
- self.canvas.translator._post(event)
+ self.game.write_file(file_path)
def get_preview(self):
"""Custom preview code to get image from pygame.