Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKshitij <Kshitij@Kshitijs-MacBook-Pro.local>2012-12-17 14:36:14 (GMT)
committer Kshitij <Kshitij@Kshitijs-MacBook-Pro.local>2012-12-17 14:36:14 (GMT)
commit6f43180bbd9da29d2630cb4fa0f7e12f4242faf0 (patch)
treee3b359d26e4d5c9ed8412685d7972c9e676f23ec
parent607cc5e10e7531e9bfe796ccbb1c2cc4cd9fc8e9 (diff)
PyGI changessugar-0.94
-rwxr-xr-xclock.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/clock.py b/clock.py
index 7f31dfc..7b4e4bd 100755
--- a/clock.py
+++ b/clock.py
@@ -69,7 +69,7 @@ GObject.threads_init()
from gi.repository import Gtk
import pyGtk
from Gtk import gdk
-import pango
+from gi.repository import Pango
import gi.repository import Gst
import cairo
import pangocairo
@@ -537,7 +537,7 @@ class ClockFace(Gtk.DrawingArea):
# letters, the method of the activity will be called back to
# refresh the display.
GObject.signal_new("time_minute", ClockFace,
- GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, [])
+ GObject.SignalFlags.RUN_LAST, None, [])
def set_display_mode(self, mode):
"""Set the type of clock to display (simple, nice, digital).
@@ -609,10 +609,10 @@ class ClockFace(Gtk.DrawingArea):
display rich text fully localizable.
"""
pango_context = self.get_pango_context()
- layout = pango.Layout(pango_context)
+ layout = Pango.Layout(pango_context)
layout.set_markup(markup)
- layout.set_alignment(pango.ALIGN_CENTER)
+ layout.set_alignment(Pango.Alignment.CENTER)
x_bearing, y_bearing, width, height = layout.get_pixel_extents()[1][:4]
x_delta = int(x - width / 2 - x_bearing)
@@ -691,7 +691,7 @@ class ClockFace(Gtk.DrawingArea):
d = int(self._center_y + 0.3 * self._radius)
pango_layout.set_markup(markup_time)
dx, dy = pango_layout.get_pixel_size()
- pango_layout.set_alignment(pango.ALIGN_CENTER)
+ pango_layout.set_alignment(Pango.Alignment.CENTER)
cr.translate(self._center_x - dx / 2.0, d - dy / 2.0)
cr.show_layout(pango_layout)