Merge pull request #26 from kivy/fix_service_path
add applibs in path for service too
This commit is contained in:
commit
3dcae5a311
1 changed files with 15 additions and 0 deletions
|
@ -625,6 +625,21 @@ class Buildozer(object):
|
||||||
copyfile(join(dirname(__file__), 'sitecustomize.py'),
|
copyfile(join(dirname(__file__), 'sitecustomize.py'),
|
||||||
join(self.app_dir, 'sitecustomize.py'))
|
join(self.app_dir, 'sitecustomize.py'))
|
||||||
|
|
||||||
|
main_py = join(self.app_dir, 'service', 'main.py')
|
||||||
|
if not self.file_exists(main_py):
|
||||||
|
#self.error('Unable to patch main_py to add applibs directory.')
|
||||||
|
return
|
||||||
|
|
||||||
|
header = ('import sys, os; '
|
||||||
|
'sys.path = [os.path.join(os.getcwd(),'
|
||||||
|
'"..", "_applibs")] + sys.path\n')
|
||||||
|
with open(main_py, 'rb') as fd:
|
||||||
|
data = fd.read()
|
||||||
|
data = header + data
|
||||||
|
with open(main_py, 'wb') as fd:
|
||||||
|
fd.write(data)
|
||||||
|
self.info('Patched service/main.py to include applibs')
|
||||||
|
|
||||||
def namify(self, name):
|
def namify(self, name):
|
||||||
'''Return a "valid" name from a name with lot of invalid chars
|
'''Return a "valid" name from a name with lot of invalid chars
|
||||||
(allowed characters: a-z, A-Z, 0-9, -, _)
|
(allowed characters: a-z, A-Z, 0-9, -, _)
|
||||||
|
|
Loading…
Reference in a new issue