Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@sugarlabs.org>2014-04-11 01:40:06 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-05-14 21:21:40 (GMT)
commitdd749da6fdc05374ee656762f6c34d2c52ca6779 (patch)
treea49013aacb60e79f2298e4f42f2ed31ce6de6133
parent1394eb71f8e677990ca26d3be4e1fb1af708f950 (diff)
More import fixes
-rw-r--r--activity.py1
-rw-r--r--character.py8
-rw-r--r--dialogs.py6
-rw-r--r--editmap.py2
-rwxr-xr-xgame.py1
-rw-r--r--mapnav.py9
-rw-r--r--mapview.py3
-rw-r--r--model.py1
-rw-r--r--questions.py6
-rw-r--r--resources.py9
-rw-r--r--stateview.py4
11 files changed, 23 insertions, 27 deletions
diff --git a/activity.py b/activity.py
index 228a2e1..702f52a 100644
--- a/activity.py
+++ b/activity.py
@@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from gi.repository import Gtk
+from gi.repository import GObject
import logging
from gettext import gettext as _
diff --git a/character.py b/character.py
index 28e4c2a..ea47da3 100644
--- a/character.py
+++ b/character.py
@@ -1,10 +1,6 @@
-import logging
-
from gi.repository import Gtk
-from gi.repository import Gdk
-from gi.repository import GObject
import cairo
-import rsvg
+from gi.repository import Rsvg
class Sprite(object):
@@ -21,7 +17,7 @@ class Sprite(object):
self.load_svg()
def load_svg(self):
- self._svg = rsvg.Handle(file=self.svg_file)
+ self._svg = Rsvg.Handle.new_from_file(self.svg_file)
self._svg_width = self._svg.props.width
# create a cache with the image rendered
diff --git a/dialogs.py b/dialogs.py
index 240e51c..cd4eb0b 100644
--- a/dialogs.py
+++ b/dialogs.py
@@ -16,10 +16,11 @@
from gettext import gettext as _
import os
import random
-import logging
from gi.repository import GObject
from gi.repository import Gtk
+from gi.repository import Gdk
+from gi.repository import GdkPixbuf
from gi.repository import WebKit
from sugar3.graphics import style
@@ -37,7 +38,6 @@ class _DialogWindow(Gtk.Window):
super(_DialogWindow, self).__init__()
self.set_border_width(style.LINE_WIDTH)
- offset = style.GRID_CELL_SIZE
width = Gdk.Screen.width() - style.GRID_CELL_SIZE * 2
height = Gdk.Screen.height() - style.GRID_CELL_SIZE * 2
self.set_size_request(width, height)
@@ -129,7 +129,7 @@ class ResourceDialog(_DialogWindow):
vbox.pack_start(image, False, padding=5)
image.set_from_file(resource['file_image'])
- editor = webkit.WebView()
+ editor = WebKit.WebView()
editor.set_editable(False)
height = int(Gdk.Screen.height() / 3)
editor.set_size_request(-1, height)
diff --git a/editmap.py b/editmap.py
index 1b91c1a..1b8468f 100644
--- a/editmap.py
+++ b/editmap.py
@@ -3,6 +3,8 @@ import logging
import os
from gi.repository import Gtk
+from gi.repository import GdkPixbuf
+from gi.repository import GObject
from sugar3.activity import activity
diff --git a/game.py b/game.py
index f18ec33..9a89eb5 100755
--- a/game.py
+++ b/game.py
@@ -1,6 +1,5 @@
#!/usr/bin/python
import os
-import csv
import math
import simplejson as json
diff --git a/mapnav.py b/mapnav.py
index b6e178c..bf2d0a0 100644
--- a/mapnav.py
+++ b/mapnav.py
@@ -6,10 +6,11 @@
# The class MapNavView draw a map from the top
from gi.repository import Gtk
+from gi.repository import Gdk
+from gi.repository import GdkPixbuf
from gi.repository import GObject
-import cairo
import logging
-import rsvg
+from gi.repository import Rsvg
from sugar3.graphics import style
@@ -99,7 +100,7 @@ class MapNavView(Gtk.DrawingArea):
return False
x, y = self.x, self.y
- info_walls = self.get_information_walls(x, y, self.direction)
+ #info_walls = self.get_information_walls(x, y, self.direction)
new_x, new_y, new_direction = self.x, self.y, self.direction
if keyname == 'Up' or keyname == 'KP_Up':
@@ -380,7 +381,7 @@ class MapNavView(Gtk.DrawingArea):
# create a new dict to add the svg handle
# can't be in the model because can't be put in the json
if not 'svg_image_cache' in wall_object:
- svg = rsvg.Handle(file=image_file_name)
+ svg = Rsvg.Handle.new_from_file(image_file_name)
new_dict['svg_image_cache'] = svg
else:
if not 'pxb_image_cache' in wall_object:
diff --git a/mapview.py b/mapview.py
index 06ce54c..1966f03 100644
--- a/mapview.py
+++ b/mapview.py
@@ -6,7 +6,6 @@
# The class TopMapView draw a map from the top
from gi.repository import Gtk
-import cairo
from game_map import GameMap
# view_data = width, height, show_position
@@ -132,7 +131,7 @@ class TopMapView(Gtk.DrawingArea):
self.queue_draw()
def expose(self, widget, event):
- rect = self.get_allocation()
+ #rect = self.get_allocation()
ctx = widget.window.cairo_create()
ctx.save()
# set a clip region for the expose event
diff --git a/model.py b/model.py
index 5f601a9..c41748c 100644
--- a/model.py
+++ b/model.py
@@ -1,5 +1,4 @@
import os
-import sys
import logging
import simplejson
from sugar3.activity import activity
diff --git a/questions.py b/questions.py
index 8ca9e84..b1fdea8 100644
--- a/questions.py
+++ b/questions.py
@@ -1,12 +1,12 @@
from gi.repository import Gtk
+from gi.repository import Gdk
+from gi.repository import GdkPixbuf
from gi.repository import GObject
import logging
import os
import shutil
import cairo
-from gobject import SIGNAL_RUN_FIRST
-
from gettext import gettext as _
from sugar3.activity import activity
@@ -143,7 +143,7 @@ class DrawReplyArea(Gtk.DrawingArea):
class PrepareQuestionsWin(Gtk.HBox):
__gsignals__ = {
- 'question_updated': (SIGNAL_RUN_FIRST, None, [])
+ 'question_updated': (GObject.SignalFlags.RUN_FIRST, None, [])
}
def __init__(self, activity):
diff --git a/resources.py b/resources.py
index 28cfddf..db22557 100644
--- a/resources.py
+++ b/resources.py
@@ -1,4 +1,6 @@
from gi.repository import Gtk
+from gi.repository import Gdk
+from gi.repository import GdkPixbuf
from gi.repository import GObject
from gi.repository import WebKit
import logging
@@ -7,17 +9,14 @@ import shutil
from gettext import gettext as _
-from gobject import SIGNAL_RUN_FIRST
-
from sugar3.activity import activity
-from sugar3.graphics.icon import Icon
from sugar3.graphics.objectchooser import ObjectChooser
class CollectResourcesWin(Gtk.HBox):
__gsignals__ = {
- 'resource_updated': (SIGNAL_RUN_FIRST, None, [])
+ 'resource_updated': (GObject.SignalFlags.RUN_FIRST, None, [])
}
def __init__(self, activity):
@@ -110,7 +109,7 @@ class CollectResourcesWin(Gtk.HBox):
vbox_image.pack_start(scrolled, True, padding=5)
#hbox_editor = Gtk.HBox()
- self.editor = webkit.WebView()
+ self.editor = WebKit.WebView()
self.title_entry.connect('changed',
self.__information_changed_cb)
self.editor.set_editable(True)
diff --git a/stateview.py b/stateview.py
index 974201c..87bb534 100644
--- a/stateview.py
+++ b/stateview.py
@@ -7,8 +7,8 @@
# how many have been read, and how many have been replied.
from gi.repository import Gtk
+from gi.repository import Rsvg
import cairo
-import rsvg
import model
import math
import logging
@@ -21,7 +21,7 @@ class StateView():
self._x = x
self._y = y
self._cell_size = cell_size
- svg = rsvg.Handle(file='./icons/question.svg')
+ svg = Rsvg.Handle.new_from_file('./icons/question.svg')
self._tmp_image = cairo.ImageSurface(cairo.FORMAT_ARGB32,
svg.props.width, svg.props.height)
self._tmp_ctx = cairo.Context(self._tmp_image)