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 Python 3 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 activity/activity.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = Erikos
activity_version = 9
license = GPLv3+;MIT
bundle_id = org.sugarlabs.ErikosActivity
exec = sugar-activity ErikosActivity.ErikosActivity
exec = sugar-activity3 ErikosActivity.ErikosActivity
icon = activity-erikos
show_launcher = yes
category = game
Expand Down
4 changes: 2 additions & 2 deletions sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ def playWave(sound='horse', pitch=1, amplitude=1, loop=False, duration=1, startt

# scorelines = []
scorelines.append('i9 %f %f "%s" %s %s %s %s %s\n' % (float(starttime), float(duration), fullname, str(pitch), str(amplitude), str(lp), str(pitenv), str(ampenv)))
print scorelines
print(scorelines)

def getSoundList():
list = finddir()
if list == None:
print _("Please install TamTamEdit's sound library.")
print(_("Please install TamTamEdit's sound library."))
sys.exit(0)
return sorted(os.listdir(list))

Expand Down
6 changes: 3 additions & 3 deletions sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def redraw_sprites(self, area=None, cr=None):
else:
self.cr = cr
if cr is None:
print 'sprites.redraw_sprites: no Cairo context'
print('sprites.redraw_sprites: no Cairo context')
return
for spr in self.list:
if area == None:
Expand Down Expand Up @@ -259,7 +259,7 @@ def set_layer(self, layer=None):
def set_label(self, new_label, i=0):
''' Set the label drawn on the sprite '''
self._extend_labels_array(i)
if type(new_label) is str or type(new_label) is unicode:
if type(new_label) is str or type(new_label) is str:
# pango doesn't like nulls
self.labels[i] = new_label.replace("\0", " ")
else:
Expand Down Expand Up @@ -332,7 +332,7 @@ def draw(self, cr=None):
if cr is None:
cr = self._sprites.cr
if cr is None:
print 'sprite.draw: no Cairo context.'
print('sprite.draw: no Cairo context.')
return
for i, surface in enumerate(self.cached_surfaces):
cr.set_source_surface(surface,
Expand Down
6 changes: 3 additions & 3 deletions window.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _stepper(sw,i,j):
#
def _button_press_cb(win, event, sw):
win.grab_focus()
x, y = map(int, event.get_coords())
x, y = list(map(int, event.get_coords()))
sw.dragpos = x
spr = sw.sprites.find_sprite((x,y))
sw.press = spr
Expand All @@ -148,7 +148,7 @@ def _mouse_move_cb(win, event, sw):
return True

win.grab_focus()
x, y = map(int, event.get_coords())
x, y = list(map(int, event.get_coords()))

dx = x-sw.dragpos

Expand Down Expand Up @@ -286,5 +286,5 @@ def gen_seq(n):
seq = []
for i in range(1,n+1):
seq.append(int(random.uniform(0,4)))
print seq
print(seq)
return seq