diff options
author | Kshitij <Kshitij@Kshitijs-MacBook-Pro.local> | 2012-12-14 14:48:50 (GMT) |
---|---|---|
committer | Kshitij <Kshitij@Kshitijs-MacBook-Pro.local> | 2012-12-14 14:48:50 (GMT) |
commit | e134a0348fed94ba3598f652e5eeb20cb80c8ab9 (patch) | |
tree | 61186c2bd94b4b3491d201fec958afd613047852 | |
parent | 74be585310b86780642954a3f6a3e9fef40f02a0 (diff) |
Gtk & GObject changes
-rwxr-xr-x | colors.py | 14 | ||||
-rwxr-xr-x | setup.py | 2 |
2 files changed, 9 insertions, 7 deletions
@@ -46,9 +46,11 @@ except (ImportError, AttributeError): from colorsc import * # Import PyGTK. -import gobject, pygtk, gtk, pango +import pygtk, pango +from gi.repository import Gtk +from gi.repository import GObject # Needed to avoid thread crashes with GStreamer -gobject.threads_init() +GObject.threads_init() # Import PyGame. Used for camera and sound. try: @@ -60,7 +62,7 @@ except ImportError: import dbus, telepathy, telepathy.client from dbus import Interface from dbus.service import method, signal -from dbus.gobject_service import ExportedGObject +from dbus.GObject_service import ExportedGObject from sugar.presence.tubeconn import TubeConnection from sugar.presence import presenceservice from sugar.datastore import datastore @@ -1494,10 +1496,10 @@ class Colors(activity.Activity, ExportedGObject): def start_update_timer(self): if self.update_timer: - gobject.source_remove(self.update_timer) + GObject.source_remove(self.update_timer) # The timer priority is chosen to be above PRIORITY_REDRAW (which is PRIORITY_HIGH_IDLE_20, but not defined in PyGTK). - self.update_timer = gobject.timeout_add(1, self.update, priority=gobject.PRIORITY_HIGH_IDLE+30) + self.update_timer = GObject.timeout_add(1, self.update, priority=GObject.PRIORITY_HIGH_IDLE+30) def enter_mode (self): if self.mode == Colors.MODE_INTRO: @@ -1834,7 +1836,7 @@ class Colors(activity.Activity, ExportedGObject): self.cam.start() # flips the image to start with self.cam.set_controls(hflip = 1) - gobject.timeout_add(33, self.on_videopaint_tick, priority=gobject.PRIORITY_HIGH_IDLE+31) + GObject.timeout_add(33, self.on_videopaint_tick, priority=GObject.PRIORITY_HIGH_IDLE+31) else: self.cam.stop() @@ -16,6 +16,6 @@ # You should have received a copy of the GNU General Public License # along with Colors. If not, see <http://www.gnu.org/licenses/>. -from sugar.activity import bundlebuilder +from sugar3.activity import bundlebuilder if __name__ == "__main__": bundlebuilder.start() |