Skip to content

Commit

Permalink
Pep8 stylish corrections for hostpython:
Browse files Browse the repository at this point in the history
    - F401 XXX imported but unused
    - E303 too many blank lines (2)
    - Shortened long lines to improve reading

References: kivy#1412
  • Loading branch information
opacam committed Oct 19, 2018
1 parent 86869af commit cd3bbf9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pythonforandroid/recipes/hostpython3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pythonforandroid.toolchain import Recipe, shprint, info, warning
from pythonforandroid.toolchain import Recipe, shprint, info
from pythonforandroid.util import ensure_dir, current_directory
from os.path import join, exists
import os
import sh


Expand All @@ -18,7 +17,8 @@ def get_build_container_dir(self, arch=None):
return join(self.ctx.build_dir, 'other_builds', dir_name, 'desktop')

def get_build_dir(self, arch=None):
# Unlike other recipes, the hostpython build dir doesn't depend on the target arch
# Unlike other recipes, the hostpython
# build dir doesn't depend on the target arch
return join(self.get_build_container_dir(), self.name)

def build_arch(self, arch):
Expand All @@ -32,17 +32,19 @@ def build_arch(self, arch):
with current_directory(recipe_build_dir):
env = {} # The command line environment we will use


# Configure the build
with current_directory(build_dir):
if not exists('config.status'):
shprint(sh.Command(join(recipe_build_dir, 'configure')))
shprint(
sh.Command(join(recipe_build_dir, 'configure')))

# Create the Setup file. This copying from Setup.dist
# seems to be the normal and expected procedure.
assert exists(join(build_dir, 'Modules')), (
'Expected dir {} does not exist'.format(join(build_dir, 'Modules')))
shprint(sh.cp, join('Modules', 'Setup.dist'), join(build_dir, 'Modules', 'Setup'))
assert exists(join(build_dir, 'Modules')), \
('Expected dir {} does not exist'.format(
join(build_dir, 'Modules')))
shprint(sh.cp, join('Modules', 'Setup.dist'),
join(build_dir, 'Modules', 'Setup'))

result = shprint(sh.make, '-C', build_dir)
else:
Expand All @@ -51,4 +53,5 @@ def build_arch(self, arch):
self.ctx.hostpython = join(build_dir, 'python')
self.ctx.hostpgen = '/usr/bin/false' # is this actually used for anything?


recipe = Hostpython3Recipe()

0 comments on commit cd3bbf9

Please sign in to comment.