Skip to content

Commit e0844af

Browse files
committed
Linter fixes E111, E116, E122, E202, E225, E241...
- E111 indentation is not a multiple of four - E116 unexpected indentation (comment) - E122 continuation line missing indentation or outdented - E202 whitespace before '}' - E225 missing whitespace around operator - E241 multiple spaces after ',' - E265 block comment should start with '# ' - E266 too many leading '#' for block comment - E401 multiple imports on one line - E741 ambiguous variable name - E502 the backslash is redundant between brackets - F403 unable to detect undefined names - F811 redefinition of unused name - W292 no newline at end of file
1 parent ce56784 commit e0844af

File tree

15 files changed

+42
-40
lines changed

15 files changed

+42
-40
lines changed

pythonforandroid/archs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_env(self, with_flags_in_cc=True):
3636
env['CFLAGS'] = ' '.join([
3737
'-DANDROID', '-mandroid', '-fomit-frame-pointer'
3838
' -D__ANDROID_API__={}'.format(self.ctx._android_api),
39-
])
39+
])
4040
env['LDFLAGS'] = ' '
4141

4242
sysroot = join(self.ctx._ndk_dir, 'sysroot')

pythonforandroid/bootstraps/sdl2/build/build.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def make_package(args):
378378
url_scheme=url_scheme,
379379
private_version=str(time.time()))
380380

381-
## gradle build templates
381+
# gradle build templates
382382
render(
383383
'build.tmpl.gradle',
384384
'build.gradle',
@@ -388,7 +388,7 @@ def make_package(args):
388388
android_api=android_api,
389389
build_tools_version=build_tools_version)
390390

391-
## ant build templates
391+
# ant build templates
392392
render(
393393
'build.tmpl.xml',
394394
'build.xml',
@@ -418,10 +418,10 @@ def parse_args(args=None):
418418
tools directory of the Android SDK.
419419
''')
420420

421+
# `required=True` for launcher, crashes in make_package
422+
# if not mentioned (and the check is there anyway)
421423
ap.add_argument('--private', dest='private',
422424
help='the dir of user files')
423-
# , required=True) for launcher, crashes in make_package
424-
# if not mentioned (and the check is there anyway)
425425
ap.add_argument('--package', dest='package',
426426
help=('The name of the java package the project will be'
427427
' packaged under.'),
@@ -486,8 +486,8 @@ def parse_args(args=None):
486486
ap.add_argument('--depend', dest='depends', action='append',
487487
help=('Add a external dependency '
488488
'(eg: com.android.support:appcompat-v7:19.0.1)'))
489-
## The --sdk option has been removed, it is ignored in favour of
490-
## --android-api handled by toolchain.py
489+
# The --sdk option has been removed, it is ignored in favour of
490+
# --android-api handled by toolchain.py
491491
ap.add_argument('--sdk', dest='sdk_version', default=-1,
492492
type=int, help=('Deprecated argument, does nothing'))
493493
ap.add_argument('--minsdk', dest='min_sdk_version',

pythonforandroid/graph.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from copy import deepcopy
32
from itertools import product
43
from sys import exit

pythonforandroid/recipe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ def clean_build(self, arch=None):
548548
if exists(base_dir):
549549
dirs.append(base_dir)
550550
if not dirs:
551-
warning(('Attempted to clean build for {} but found no existing '
552-
'build dirs').format(self.name))
551+
warning(('Attempted to clean build for {} but found no existing '
552+
'build dirs').format(self.name))
553553

554554
for directory in dirs:
555555
if exists(directory):

pythonforandroid/recipes/android/src/android/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
'''
66

77
# legacy import
8-
from android._android import * # noqa: F401
8+
from android._android import * # noqa: F401, F403

pythonforandroid/recipes/android/src/android/activity.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
_callbacks = {
77
'on_new_intent': [],
8-
'on_activity_result': [] }
8+
'on_activity_result': [],
9+
}
910

1011

1112
class NewIntentListener(PythonJavaClass):

pythonforandroid/recipes/flask/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44

55
class FlaskRecipe(PythonRecipe):
6-
version = '0.10.1' # The webserver of 'master' seems to fail
7-
# after a little while on Android, so use
8-
# 0.10.1 at least for now
6+
# The webserver of 'master' seems to fail
7+
# after a little while on Android, so use
8+
# 0.10.1 at least for now
9+
version = '0.10.1'
910
url = 'https://github.com/pallets/flask/archive/{version}.zip'
1011

1112
depends = [('python2', 'python3crystax'), 'setuptools', 'genericndkbuild']

pythonforandroid/recipes/libffi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def build_arch(self, arch):
4040
'--host=' + arch.toolchain_prefix,
4141
'--prefix=' + self.ctx.get_python_install_dir(),
4242
'--enable-shared', _env=env)
43-
#'--with-sysroot={}'.format(self.ctx.ndk_platform),
44-
#'--target={}'.format(arch.toolchain_prefix),
43+
# '--with-sysroot={}'.format(self.ctx.ndk_platform),
44+
# '--target={}'.format(arch.toolchain_prefix),
4545

4646
# ndk 15 introduces unified headers required --sysroot and
4747
# -isysroot for libraries and headers. libtool's head explodes

pythonforandroid/recipes/libgeos/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class LibgeosRecipe(Recipe):
88
version = '3.5'
9-
#url = 'http://download.osgeo.org/geos/geos-{version}.tar.bz2'
9+
# url = 'http://download.osgeo.org/geos/geos-{version}.tar.bz2'
1010
url = 'https://github.com/libgeos/libgeos/archive/svn-{version}.zip'
1111
depends = ['python2']
1212

@@ -23,7 +23,7 @@ def build_arch(self, arch):
2323
bash = sh.Command('bash')
2424
print("If this fails make sure you have autoconf and libtool installed")
2525
shprint(bash, 'autogen.sh') # Requires autoconf and libtool
26-
shprint(bash, 'configure', '--host=arm-linux-androideabi', '--enable-shared', '--prefix={}'.format(dst_dir), _env=env)
26+
shprint(bash, 'configure', '--host=arm-linux-androideabi', '--enable-shared', '--prefix={}'.format(dst_dir), _env=env)
2727
shprint(sh.make, '-j', str(cpu_count()), _env=env)
2828
shprint(sh.make, 'install', _env=env)
2929
shutil.copyfile('{}/lib/libgeos_c.so'.format(dst_dir), join(self.ctx.get_libs_dir(arch.arch), 'libgeos_c.so'))

pythonforandroid/recipes/opencv/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class OpenCVRecipe(NDKRecipe):
1212
version = '2.4.10.1'
1313
url = 'https://github.com/Itseez/opencv/archive/{version}.zip'
14-
#md5sum = '2ddfa98e867e6611254040df841186dc'
14+
# md5sum = '2ddfa98e867e6611254040df841186dc'
1515
depends = ['numpy']
1616
patches = ['patches/p4a_build-2.4.10.1.patch']
1717
generated_libraries = ['cv2.so']

0 commit comments

Comments
 (0)