Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to python3 #3

Merged
merged 5 commits into from
Jan 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion YupanaActivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, handle):
""" Initialize the toolbars and the yupana """
try:
super(YupanaActivity, self).__init__(handle)
except dbus.exceptions.DBusException, e:
except dbus.exceptions.DBusException as e:
_logger.error(str(e))

self.nick = profile.get_nick_name()
Expand Down
2 changes: 1 addition & 1 deletion activity/activity.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = Yupana
activity_version = 17
license = GPLv3
bundle_id = org.sugarlabs.YupanaActivity
exec = sugar-activity YupanaActivity.YupanaActivity
exec = sugar-activity3 YupanaActivity.YupanaActivity
icon = activity-yupana
show_launcher = yes
summary = Incan calculator
Expand Down
4 changes: 2 additions & 2 deletions sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def draw(self, cr=None):
self.rect[3])
cr.fill()
else:
print 'sprite.draw: source not a pixbuf (%s)' % (type(img))
print('sprite.draw: source not a pixbuf (%s)' % (type(img)))
if len(self.labels) > 0:
self.draw_label(cr)

Expand Down Expand Up @@ -459,5 +459,5 @@ def get_pixel(self, pos, i=0):
else:
return(-1, -1, -1, -1)
except IndexError:
print "Index Error: %d %d" % (len(array), offset)
print("Index Error: %d %d" % (len(array), offset))
return(-1, -1, -1, -1)
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Foundation, 51 Franklin Street, Suite 500 Boston, MA 02110-1335 USA


from StringIO import StringIO
from io import StringIO
import json
json.dumps
from json import load as jload
Expand Down
4 changes: 2 additions & 2 deletions yupana.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def _set_label(self, string):

def _button_press_cb(self, win, event):
win.grab_focus()
x, y = map(int, event.get_coords())
x, y = list(map(int, event.get_coords()))

spr = self._sprites.find_sprite((x, y))
if spr == None:
Expand Down Expand Up @@ -522,5 +522,5 @@ def svg_str_to_pixbuf(svg_string):
pixbuf = pl.get_pixbuf()
return pixbuf
except:
print svg_string
print(svg_string)
return None