Permalink
Browse files

Move activity specific bits to it's own package

  • Loading branch information...
Luke Closs
Luke Closs committed Apr 28, 2008
1 parent 729e2c4 commit 188489c6a4877577d3e9ba24acb8c97eaee6ff0a
Showing with 0 additions and 679 deletions.
  1. BIN OnePageWikiActivity-1.xo
  2. +0 −39 OnePageWikiActivity.py
  3. +0 −588 activity/activity-onepagewiki.svg
  4. +0 −7 activity/activity.info
  5. +0 −45 test-web-view.py
View
Binary file not shown.
View
@@ -1,39 +0,0 @@
-from sugar.activity import activity
-from sugar import env
-import os
-import gtk
-import gobject
-import hulahop
-hulahop.startup(os.path.join(env.get_profile_path(), 'gecko'))
-from XOCom import XOCom
-
-class OnePageWikiActivity (activity.Activity):
- def __init__(self, handle):
- activity.Activity.__init__(self, handle)
- self.set_title('OnePageWiki')
-
- # The XOCom object helps us communicate with the browser
- # This uses web/index.html as the default page to load
- self.xocom = XOCom()
-
- toolbox = activity.ActivityToolbox(self)
- self.set_toolbox(toolbox)
- toolbox.show()
-
- self.set_canvas( self.xocom.create_webview() )
-
- def write_file(self, filename):
- content = self.xocom.send_to_browser('write')
- if content:
- fh = open(filename, 'w')
- fh.write(content)
- fh.close()
-
- def read_file(self, filename):
- fh = open(filename, 'r')
- content = fh.read()
- # We must delay this to give the browser time to start up
- # It would be better if this send_to_browser was instead triggered
- # once the browser had finished loading.
- gobject.timeout_add(2000, self.xocom.send_to_browser, 'read', content)
-
Oops, something went wrong.

0 comments on commit 188489c

Please sign in to comment.