diff --git a/pythonforandroid/bootstraps/pygame/__init__.py b/pythonforandroid/bootstraps/pygame/__init__.py index 74197bd949..eac81f2901 100644 --- a/pythonforandroid/bootstraps/pygame/__init__.py +++ b/pythonforandroid/bootstraps/pygame/__init__.py @@ -54,7 +54,7 @@ def run_distribute(self): if not exists('python-install'): shprint(sh.cp, '-a', self.ctx.get_python_install_dir(), './python-install') - self.distribute_libs(arch, [join(self.build_dir, 'libs', arch.arch), self.ctx.get_libs_dir(arch.arch)]); + self.distribute_libs(arch, [join(self.build_dir, 'libs', arch.arch), self.ctx.get_libs_dir(arch.arch)]) self.distribute_aars(arch) self.distribute_javaclasses(self.ctx.javaclass_dir) diff --git a/pythonforandroid/bootstraps/pygame/build/build.py b/pythonforandroid/bootstraps/pygame/build/build.py index 6991adebfe..46a6b64f25 100755 --- a/pythonforandroid/bootstraps/pygame/build/build.py +++ b/pythonforandroid/bootstraps/pygame/build/build.py @@ -183,7 +183,6 @@ def select(fn): tf = tarfile.open(tfn, 'w:gz', format=tarfile.USTAR_FORMAT) dirs = [] for fn, afn in files: -# print('%s: %s' % (tfn, fn)) dn = dirname(afn) if dn not in dirs: # create every dirs first if not exist yet diff --git a/pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py b/pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py index ef6296c384..8d097d33b4 100644 --- a/pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py +++ b/pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py @@ -705,7 +705,7 @@ def _get_action_name(argument): if argument is None: return None elif argument.option_strings: - return '/'.join(argument.option_strings) + return '/'.join(argument.option_strings) elif argument.metavar not in (None, SUPPRESS): return argument.metavar elif argument.dest not in (None, SUPPRESS): diff --git a/pythonforandroid/bootstraps/pygame/build/tools/biglink b/pythonforandroid/bootstraps/pygame/build/tools/biglink index 1f82d18b48..2e3d2bbe99 100755 --- a/pythonforandroid/bootstraps/pygame/build/tools/biglink +++ b/pythonforandroid/bootstraps/pygame/build/tools/biglink @@ -5,7 +5,7 @@ import os import sys import subprocess -sofiles = [ ] +sofiles = [] for directory in sys.argv[2:]: @@ -20,7 +20,7 @@ for directory in sys.argv[2:]: sofiles.append(fn[:-2]) # The raw argument list. -args = [ ] +args = [] for fn in sofiles: afn = fn + ".o" @@ -31,7 +31,7 @@ for fn in sofiles: data = fd.read() args.extend(data.split(" ")) -unique_args = [ ] +unique_args = [] while args: a = args.pop() if a in ('-L', ): diff --git a/pythonforandroid/bootstraps/pygame/build/tools/biglink-jb b/pythonforandroid/bootstraps/pygame/build/tools/biglink-jb index ef3004f5bc..a0ccb16325 100755 --- a/pythonforandroid/bootstraps/pygame/build/tools/biglink-jb +++ b/pythonforandroid/bootstraps/pygame/build/tools/biglink-jb @@ -25,7 +25,7 @@ blacklist_libs = ( ) found_libs = [] -sofiles = [ ] +sofiles = [] for directory in sys.argv[2:]: diff --git a/pythonforandroid/bootstraps/pygame/build/tools/liblink b/pythonforandroid/bootstraps/pygame/build/tools/liblink index cf7f26d3bc..caf051dfff 100755 --- a/pythonforandroid/bootstraps/pygame/build/tools/liblink +++ b/pythonforandroid/bootstraps/pygame/build/tools/liblink @@ -6,8 +6,8 @@ import subprocess from os import environ from os.path import basename, join -libs = [ ] -objects = [ ] +libs = [] +objects = [] output = None diff --git a/pythonforandroid/bootstraps/pygame/build/tools/liblink-jb b/pythonforandroid/bootstraps/pygame/build/tools/liblink-jb index 46dc1ca325..4b43bee2b7 100755 --- a/pythonforandroid/bootstraps/pygame/build/tools/liblink-jb +++ b/pythonforandroid/bootstraps/pygame/build/tools/liblink-jb @@ -6,8 +6,8 @@ import subprocess from os import environ from os.path import basename, join -libs = [ ] -libdirs = [ ] +libs = [] +libdirs = [] output = None diff --git a/pythonforandroid/bootstraps/sdl2/build/build.py b/pythonforandroid/bootstraps/sdl2/build/build.py index 8665fc76f4..ef60d63545 100644 --- a/pythonforandroid/bootstraps/sdl2/build/build.py +++ b/pythonforandroid/bootstraps/sdl2/build/build.py @@ -187,7 +187,6 @@ def select(fn): tf = tarfile.open(tfn, 'w:gz', format=tarfile.USTAR_FORMAT) dirs = [] for fn, afn in files: -# print('%s: %s' % (tfn, fn)) dn = dirname(afn) if dn not in dirs: # create every dirs first if not exist yet diff --git a/pythonforandroid/bootstraps/service_only/build/build.py b/pythonforandroid/bootstraps/service_only/build/build.py index eef8ca47dd..9364b71b1b 100755 --- a/pythonforandroid/bootstraps/service_only/build/build.py +++ b/pythonforandroid/bootstraps/service_only/build/build.py @@ -178,7 +178,6 @@ def select(fn): tf = tarfile.open(tfn, 'w:gz', format=tarfile.USTAR_FORMAT) dirs = [] for fn, afn in files: -# print('%s: %s' % (tfn, fn)) dn = dirname(afn) if dn not in dirs: # create every dirs first if not exist yet diff --git a/pythonforandroid/bootstraps/webview/build/build.py b/pythonforandroid/bootstraps/webview/build/build.py index 28851aa8e5..bcdf17b533 100755 --- a/pythonforandroid/bootstraps/webview/build/build.py +++ b/pythonforandroid/bootstraps/webview/build/build.py @@ -179,7 +179,6 @@ def select(fn): tf = tarfile.open(tfn, 'w:gz', format=tarfile.USTAR_FORMAT) dirs = [] for fn, afn in files: -# print('%s: %s' % (tfn, fn)) dn = dirname(afn) if dn not in dirs: # create every dirs first if not exist yet diff --git a/pythonforandroid/recipes/android/src/android/mixer.py b/pythonforandroid/recipes/android/src/android/mixer.py index af3a5aeb46..303a9530e1 100644 --- a/pythonforandroid/recipes/android/src/android/mixer.py +++ b/pythonforandroid/recipes/android/src/android/mixer.py @@ -61,7 +61,7 @@ def fadeout(time): # A map from channel number to Channel object. -channels = { } +channels = {} def set_num_channels(count): @@ -80,7 +80,7 @@ def set_reserved(count): def find_channel(force=False): - busy = [ ] + busy = [] for i in range(reserved_channels, num_channels): c = Channel(i) @@ -195,7 +195,7 @@ def Channel(n): sound_serial = 0 -sounds = { } +sounds = {} class Sound(object): diff --git a/pythonforandroid/recipes/audiostream/__init__.py b/pythonforandroid/recipes/audiostream/__init__.py index 161d8505df..e6afa21e54 100644 --- a/pythonforandroid/recipes/audiostream/__init__.py +++ b/pythonforandroid/recipes/audiostream/__init__.py @@ -4,7 +4,7 @@ class AudiostreamRecipe(CythonRecipe): - version = 'master' + version = 'master' url = 'https://github.com/kivy/audiostream/archive/{version}.zip' name = 'audiostream' depends = ['python2', ('sdl', 'sdl2'), 'pyjnius'] @@ -21,9 +21,9 @@ def get_recipe_env(self, arch): env['SDL2_INCLUDE_DIR'] = '/home/kivy/.buildozer/android/platform/android-ndk-r9c/sources/android/support/include' env['CFLAGS'] += ' -I{jni_path}/{sdl_include}/include -I{jni_path}/{sdl_mixer_include}'.format( - jni_path = join(self.ctx.bootstrap.build_dir, 'jni'), - sdl_include = sdl_include, - sdl_mixer_include = sdl_mixer_include) + jni_path=join(self.ctx.bootstrap.build_dir, 'jni'), + sdl_include=sdl_include, + sdl_mixer_include=sdl_mixer_include) return env diff --git a/pythonforandroid/recipes/ifaddrs/__init__.py b/pythonforandroid/recipes/ifaddrs/__init__.py index 481935b5f7..f53cde1e00 100644 --- a/pythonforandroid/recipes/ifaddrs/__init__.py +++ b/pythonforandroid/recipes/ifaddrs/__init__.py @@ -26,7 +26,7 @@ def should_build(self, arch): def prebuild_arch(self, arch): """Make the build and target directories""" path = self.get_build_dir(arch.arch) - if not exists(path): + if not exists(path): info("creating {}".format(path)) shprint(sh.mkdir, '-p', path) @@ -37,7 +37,7 @@ def build_arch(self, arch): join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Lib'), join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Include'), ): - if not exists(path): + if not exists(path): info("creating {}".format(path)) shprint(sh.mkdir, '-p', path) cli = env['CC'].split() diff --git a/pythonforandroid/recipes/libglob/__init__.py b/pythonforandroid/recipes/libglob/__init__.py index 7ef7f42049..09e69d1840 100644 --- a/pythonforandroid/recipes/libglob/__init__.py +++ b/pythonforandroid/recipes/libglob/__init__.py @@ -31,7 +31,7 @@ def should_build(self, arch): def prebuild_arch(self, arch): """Make the build and target directories""" path = self.get_build_dir(arch.arch) - if not exists(path): + if not exists(path): info("creating {}".format(path)) shprint(sh.mkdir, '-p', path) @@ -42,7 +42,7 @@ def build_arch(self, arch): join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Lib'), join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Include'), ): - if not exists(path): + if not exists(path): info("creating {}".format(path)) shprint(sh.mkdir, '-p', path) cli = env['CC'].split() diff --git a/pythonforandroid/recipes/libtorrent/__init__.py b/pythonforandroid/recipes/libtorrent/__init__.py index 556d75f54d..74afe0ef24 100644 --- a/pythonforandroid/recipes/libtorrent/__init__.py +++ b/pythonforandroid/recipes/libtorrent/__init__.py @@ -16,7 +16,7 @@ class LibtorrentRecipe(Recipe): patches = ['disable-so-version.patch', 'use-soname-python.patch', 'setup-lib-name.patch'] def should_build(self, arch): - return not ( self.has_libs(arch, 'libboost_python.so', 'libboost_system.so', 'libtorrent_rasterbar.so') + return not (self.has_libs(arch, 'libboost_python.so', 'libboost_system.so', 'libtorrent_rasterbar.so') and self.ctx.has_package('libtorrent', arch.arch) ) def prebuild_arch(self, arch): diff --git a/pythonforandroid/tools/biglink b/pythonforandroid/tools/biglink index 6b86dbf841..e2652d52c9 100755 --- a/pythonforandroid/tools/biglink +++ b/pythonforandroid/tools/biglink @@ -5,7 +5,7 @@ import os import sys import subprocess -sofiles = [ ] +sofiles = [] for directory in sys.argv[2:]: @@ -20,7 +20,7 @@ for directory in sys.argv[2:]: sofiles.append(fn[:-2]) # The raw argument list. -args = [ ] +args = [] for fn in sofiles: afn = fn + ".o" @@ -31,7 +31,7 @@ for fn in sofiles: data = fd.read() args.extend(data.split(" ")) -unique_args = [ ] +unique_args = [] while args: a = args.pop() if a in ('-L', ): diff --git a/tox.ini b/tox.ini index 63107c50ec..fa0b1da4a2 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ commands = flake8 pythonforandroid/ [flake8] ignore = - E111, E114, E115, E116, E202, E121, E123, E124, E225, E126, E127, E128, - E129, E201, E221, E226, E241, E251, E265, E266, E271, - E401, E402, E501, E502, E703, E722, E741, F403, + E111, E114, E116, E202, E121, E123, E124, E225, E126, E127, E128, + E129, E226, E241, E265, E266, + E401, E402, E501, E502, E722, E741, F403, F812, F841, F811, W292, W503