diff --git a/activities/Makefile.am b/activities/Makefile.am index 84bfa85..66b25d9 100644 --- a/activities/Makefile.am +++ b/activities/Makefile.am @@ -1 +1 @@ -SUBDIRS = browser chat terminal +SUBDIRS = browser chat terminal hello diff --git a/activities/hello/HelloActivity.py b/activities/hello/HelloActivity.py new file mode 100644 index 0000000..2a92999 --- /dev/null +++ b/activities/hello/HelloActivity.py @@ -0,0 +1,39 @@ + +import logging +import os +import time +import gtk + +from sugar.activity.Activity import Activity +import HelloConfig + + +class AbiWord(gtk.Socket): + + def __init__ (self): + gtk.Socket.__init__ (self) + + + def plug_in (self): + + fp = open (HelloConfig.PREFIX + "/var/run/abiword/wid") + id = fp.read () + fp.close () + self.add_id (int (id)) + + +class HelloActivity (Activity): + + def __init__ (self, service, args): + Activity.__init__ (self, service) + + self.set_title ("Hello") + + hello = AbiWord () + self.add (hello) + + os.spawnlp (os.P_NOWAIT, 'abiword', '/dev/null') + time.sleep (5) + + hello.plug_in () + hello.show_all () diff --git a/activities/hello/HelloConfig.py.in b/activities/hello/HelloConfig.py.in new file mode 100644 index 0000000..d805a02 --- /dev/null +++ b/activities/hello/HelloConfig.py.in @@ -0,0 +1,2 @@ + +PREFIX = "@prefix@" diff --git a/activities/hello/Makefile.am b/activities/hello/Makefile.am new file mode 100644 index 0000000..8bdb2d7 --- /dev/null +++ b/activities/hello/Makefile.am @@ -0,0 +1,7 @@ +sugardir = $(pkgdatadir)/activities/hello +sugar_PYTHON = \ + __init__.py \ + HelloConfig.py \ + HelloActivity.py + +EXTRA_DIST = hello.activity diff --git a/activities/hello/__init__.py b/activities/hello/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/activities/hello/hello.activity b/activities/hello/hello.activity new file mode 100644 index 0000000..6c1dee5 --- /dev/null +++ b/activities/hello/hello.activity @@ -0,0 +1,5 @@ +[Activity] +name = Hello +id = org.sugar.Hello +python_module = hello.HelloActivity.HelloActivity +show_launcher = yes diff --git a/configure.ac b/configure.ac index 46598fd..9e54fa4 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,8 @@ activities/Makefile activities/browser/Makefile activities/chat/Makefile activities/terminal/Makefile +activities/hello/Makefile +activities/hello/HelloConfig.py shell/Makefile shell/data/Makefile shell/PresenceService/Makefile