Skip to content

Commit 34ac4fb

Browse files
committed
Rearranged testapp folders and build files
1 parent 18a7b79 commit 34ac4fb

File tree

11 files changed

+172
-353
lines changed

11 files changed

+172
-353
lines changed

testapps/setup_keyboard.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
from distutils.core import setup
3+
from setuptools import find_packages
4+
5+
options = {'apk': {'debug': None,
6+
'requirements': 'sdl2,pyjnius,kivy,python2',
7+
'android-api': 19,
8+
'ndk-dir': '/home/asandy/android/crystax-ndk-10.3.2',
9+
'dist-name': 'bdisttest',
10+
'ndk-version': '10.3.2',
11+
'permission': 'VIBRATE',
12+
}}
13+
14+
package_data = {'': ['*.py',
15+
'*.png']
16+
}
17+
18+
packages = find_packages()
19+
print('packages are', packages)
20+
21+
setup(
22+
name='testapp_keyboard',
23+
version='1.1',
24+
description='p4a setup.py test',
25+
author='Alexander Taylor',
26+
author_email='alexanderjohntaylor@gmail.com',
27+
packages=find_packages(),
28+
options=options,
29+
package_data={'setup_keyboard': ['*.py', '*.png']}
30+
)

testapps/setup_pygame.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
from distutils.core import setup
3+
from setuptools import find_packages
4+
5+
options = {'apk': {'debug': None,
6+
'requirements': 'pygame,pyjnius,kivy,python2',
7+
'android-api': 19,
8+
'ndk-dir': '/home/asandy/android/crystax-ndk-10.3.2',
9+
'dist-name': 'bdisttest_pygame',
10+
'orientation': 'portrait',
11+
'ndk-version': '10.3.2',
12+
'permission': 'VIBRATE',
13+
}}
14+
15+
package_data = {'': ['*.py',
16+
'*.png']
17+
}
18+
19+
packages = find_packages()
20+
print('packages are', packages)
21+
22+
setup(
23+
name='testapp_setup_pygame',
24+
version='1.1',
25+
description='p4a setup.py test with pygame',
26+
author='Alexander Taylor',
27+
author_email='alexanderjohntaylor@gmail.com',
28+
packages=find_packages(),
29+
options=options,
30+
package_data={'testapp_pygame': ['*.py', '*.png']}
31+
)

testapps/testapp_setup/setup.py renamed to testapps/setup_testapp_python2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
print('packages are', packages)
2020

2121
setup(
22-
name='testapp_setup',
22+
name='testapp_python2',
2323
version='1.1',
2424
description='p4a setup.py test',
2525
author='Alexander Taylor',

testapps/setup_testapp_python3.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
from distutils.core import setup
3+
from setuptools import find_packages
4+
5+
options = {'apk': {'debug': None,
6+
'requirements': 'sdl2,pyjnius,kivy,python3crystax',
7+
'android-api': 19,
8+
'ndk-dir': '/home/asandy/android/crystax-ndk-10.3.2',
9+
'dist-name': 'bdisttest',
10+
'ndk-version': '10.3.2',
11+
'permission': 'VIBRATE',
12+
}}
13+
14+
package_data = {'': ['*.py',
15+
'*.png']
16+
}
17+
18+
packages = find_packages()
19+
print('packages are', packages)
20+
21+
setup(
22+
name='testapp_python2',
23+
version='1.1',
24+
description='p4a setup.py test',
25+
author='Alexander Taylor',
26+
author_email='alexanderjohntaylor@gmail.com',
27+
packages=find_packages(),
28+
options=options,
29+
package_data={'testapp': ['*.py', '*.png']}
30+
)

testapps/setup_vispy.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
from distutils.core import setup
3+
from setuptools import find_packages
4+
5+
options = {'apk': {'debug': None,
6+
'requirements': 'vispy',
7+
'android-api': 19,
8+
'ndk-dir': '/home/asandy/android/crystax-ndk-10.3.2',
9+
'dist-name': 'bdisttest',
10+
'ndk-version': '10.3.2',
11+
'permission': 'VIBRATE',
12+
}}
13+
14+
package_data = {'': ['*.py',
15+
'*.png']
16+
}
17+
18+
packages = find_packages()
19+
print('packages are', packages)
20+
21+
setup(
22+
name='testapp_vispy',
23+
version='1.1',
24+
description='p4a setup.py test',
25+
author='Alexander Taylor',
26+
author_email='alexanderjohntaylor@gmail.com',
27+
packages=find_packages(),
28+
options=options,
29+
package_data={'testapp_vispy': ['*.py', '*.png']}
30+
)

testapps/testapp/main.py

Lines changed: 50 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
import os
44
print('imported os')
55

6-
print('contents of ./lib/python2.7/site-packages/ etc.')
7-
print(os.listdir('./lib'))
8-
print(os.listdir('./lib/python2.7'))
9-
print(os.listdir('./lib/python2.7/site-packages'))
6+
from kivy import platform
107

11-
print('contents of this dir', os.listdir('./'))
8+
if platform == 'android':
9+
print('contents of ./lib/python2.7/site-packages/ etc.')
10+
print(os.listdir('./lib'))
11+
print(os.listdir('./lib/python2.7'))
12+
print(os.listdir('./lib/python2.7/site-packages'))
1213

13-
with open('./lib/python2.7/site-packages/kivy/app.pyo', 'rb') as fileh:
14-
print('app.pyo size is', len(fileh.read()))
14+
print('this dir is', os.path.abspath(os.curdir))
15+
16+
print('contents of this dir', os.listdir('./'))
17+
18+
with open('./lib/python2.7/site-packages/kivy/app.pyo', 'rb') as fileh:
19+
print('app.pyo size is', len(fileh.read()))
1520

1621
import sys
1722
print('pythonpath is', sys.path)
@@ -35,61 +40,51 @@
3540

3641
kv = '''
3742
#:import Metrics kivy.metrics.Metrics
43+
#:import Window kivy.core.window.Window
3844
3945
<FixedSizeButton@Button>:
4046
size_hint_y: None
4147
height: dp(60)
4248
4349
44-
ScrollView:
45-
GridLayout:
46-
cols: 1
50+
BoxLayout:
51+
orientation: 'vertical'
52+
BoxLayout:
4753
size_hint_y: None
48-
height: self.minimum_height
49-
FixedSizeButton:
50-
text: 'test pyjnius'
51-
on_press: app.test_pyjnius()
52-
Image:
53-
keep_ratio: False
54-
allow_stretch: True
55-
source: 'colours.png'
56-
size_hint_y: None
57-
height: dp(100)
58-
Label:
59-
height: self.texture_size[1]
60-
size_hint_y: None
61-
font_size: 100
62-
text_size: self.size[0], None
63-
markup: True
64-
text: '[b]Kivy[/b] on [b]SDL2[/b] on [b]Android[/b]!'
65-
halign: 'center'
66-
Widget:
67-
size_hint_y: None
68-
height: 20
69-
Label:
70-
height: self.texture_size[1]
71-
size_hint_y: None
72-
font_size: 50
73-
text_size: self.size[0], None
74-
markup: True
75-
text: 'dpi: {}\\ndensity: {}\\nfontscale: {}'.format(Metrics.dpi, Metrics.density, Metrics.fontscale)
76-
halign: 'center'
77-
FixedSizeButton:
78-
text: 'test ctypes'
79-
on_press: app.test_ctypes()
80-
FixedSizeButton:
81-
text: 'test numpy'
82-
on_press: app.test_numpy()
83-
Widget:
84-
size_hint_y: None
85-
height: 1000
86-
on_touch_down: print 'touched at', args[-1].pos
87-
88-
<ErrorPopup>:
89-
title: 'Error'
90-
size_hint: 0.75, 0.75
91-
Label:
92-
text: root.error_text
54+
height: dp(50)
55+
orientation: 'horizontal'
56+
Button:
57+
text: 'None'
58+
on_press: Window.softinput_mode = ''
59+
Button:
60+
text: 'pan'
61+
on_press: Window.softinput_mode = 'pan'
62+
Button:
63+
text: 'below_target'
64+
on_press: Window.softinput_mode = 'below_target'
65+
Button:
66+
text: 'resize'
67+
on_press: Window.softinput_mode = 'resize'
68+
Widget:
69+
Scatter:
70+
id: scatter
71+
size_hint: None, None
72+
size: dp(300), dp(80)
73+
on_parent: self.pos = (300, 100)
74+
BoxLayout:
75+
size: scatter.size
76+
orientation: 'horizontal'
77+
canvas:
78+
Color:
79+
rgba: 1, 0, 0, 1
80+
Rectangle:
81+
pos: 0, 0
82+
size: self.size
83+
Widget:
84+
size_hint_x: None
85+
width: dp(30)
86+
TextInput:
87+
text: 'type in me'
9388
'''
9489

9590

@@ -145,6 +140,5 @@ def test_numpy(self, *args):
145140
print(numpy.zeros(5))
146141
print(numpy.arange(5))
147142
print(numpy.random.random((3, 3)))
148-
149143

150144
TestApp().run()

testapps/testapp_setup/setup.cfg

Whitespace-only changes.
-187 KB
Binary file not shown.

0 commit comments

Comments
 (0)