Merge lp:~illume/pgs4a/fixes into lp:pgs4a

Proposed by illume
Status: Needs review
Proposed branch: lp:~illume/pgs4a/fixes
Merge into: lp:pgs4a
Diff against target: 60 lines (+16/-5)
2 files modified
jni/application/python/start.pyx (+6/-1)
runtimelib/android_sound.pyx (+10/-4)
To merge this branch: bzr merge lp:~illume/pgs4a/fixes
Reviewer Review Type Date Requested Status
Pygame Subset for Android Pending
Review via email: mp+53152@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tom Rothamel (renpytom) wrote :

Could you try the Ubuntu version of cython? It seems to support three-argument getattr.

Unmerged revisions

100. By illume

Version of pyrex on ubuntu does not support 3 arg gettattr. Made 3rd arg work.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jni/application/python/start.pyx'
2--- jni/application/python/start.pyx 2011-02-21 21:40:39 +0000
3+++ jni/application/python/start.pyx 2011-03-12 22:33:06 +0000
4@@ -8,6 +8,11 @@
5 cdef extern initandroid()
6
7 import sys
8+def _getattr(o, attr, default):
9+ try:
10+ return getattr(o, attr)
11+ except AttributeError:
12+ return default
13
14 class LogFile(object):
15 def __init__(self):
16@@ -52,7 +57,7 @@
17
18 import main
19
20- if getattr(main, "main", None):
21+ if _getattr(main, "main", None):
22 main.main()
23
24 except:
25
26=== modified file 'runtimelib/android_sound.pyx'
27--- runtimelib/android_sound.pyx 2011-02-19 17:09:14 +0000
28+++ runtimelib/android_sound.pyx 2011-03-12 22:33:06 +0000
29@@ -15,13 +15,19 @@
30 channels = set()
31 volumes = { }
32
33+def _getattr(o, attr, default):
34+ try:
35+ return getattr(o, attr)
36+ except AttributeError:
37+ return default
38+
39 def queue(channel, file, name, fadein=0, tight=False):
40
41 channels.add(channel)
42
43 real_fn = file.name
44- base = getattr(file, "base", -1)
45- length = getattr(file, "length", -1)
46+ base = _getattr(file, "base", -1)
47+ length = _getattr(file, "length", -1)
48
49 android_sound_queue(channel, name, real_fn, base, length)
50
51@@ -30,8 +36,8 @@
52 channels.add(channel)
53
54 real_fn = file.name
55- base = getattr(file, "base", -1)
56- length = getattr(file, "length", -1)
57+ base = _getattr(file, "base", -1)
58+ length = _getattr(file, "length", -1)
59
60 android_sound_play(channel, name, real_fn, base, length)
61

Subscribers

People subscribed via source and target branches

to status/vote changes: