Skip to content

Commit 74bf788

Browse files
authored
Merge pull request #1286 from AndreMiras/feature/tox_flake8_spacing
Fixes linter E203 E231 E261 E302 E303 E305 W291 W293 W391
2 parents 442a3a8 + b3d3d45 commit 74bf788

File tree

104 files changed

+232
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+232
-144
lines changed

pythonforandroid/bdistapk.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def initialize_options(self):
3333
for (option, (source, value)) in option_dict.items():
3434
setattr(self, option, str(value))
3535

36-
3736
def finalize_options(self):
3837

3938
setup_options = self.distribution.get_option_dict('apk')
@@ -133,7 +132,7 @@ def prepare_build_dir(self):
133132
def _set_user_options():
134133
# This seems like a silly way to do things, but not sure if there's a
135134
# better way to pass arbitrary options onwards to p4a
136-
user_options = [('requirements=', None, None),]
135+
user_options = [('requirements=', None, None), ]
137136
for i, arg in enumerate(sys.argv):
138137
if arg.startswith('--'):
139138
if ('=' in arg or
@@ -144,4 +143,5 @@ def _set_user_options():
144143

145144
BdistAPK.user_options = user_options
146145

147-
_set_user_options()
146+
147+
_set_user_options()

pythonforandroid/bootstraps/empty/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ def run_distribute(self):
1212
print('empty bootstrap has no distribute')
1313
exit(1)
1414

15+
1516
bootstrap = EmptyBootstrap()

pythonforandroid/bootstraps/pygame/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def run_distribute(self):
6464
shprint(sh.mkdir, '-p', join('private', 'include', 'python2.7'))
6565

6666
shprint(sh.mv, join('libs', arch.arch, 'libpymodules.so'), 'private/')
67-
shprint(sh.cp, join('python-install', 'include' , 'python2.7', 'pyconfig.h'), join('private', 'include', 'python2.7/'))
67+
shprint(sh.cp, join('python-install', 'include', 'python2.7', 'pyconfig.h'), join('private', 'include', 'python2.7/'))
6868

6969
info('Removing some unwanted files')
7070
shprint(sh.rm, '-f', join('private', 'lib', 'libpython2.7.so'))
@@ -91,8 +91,8 @@ def run_distribute(self):
9191
shprint(sh.rm, '-rf', 'lib-dynload/_ctypes_test.so')
9292
shprint(sh.rm, '-rf', 'lib-dynload/_testcapi.so')
9393

94-
9594
self.strip_libraries(arch)
9695
super(PygameBootstrap, self).run_distribute()
9796

97+
9898
bootstrap = PygameBootstrap()

pythonforandroid/bootstraps/pygame/build/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ def make_package(args):
370370
print('Did you install ant on your system ?')
371371
sys.exit(-1)
372372

373+
373374
def parse_args(args=None):
374375
import argparse
375376

pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@
9595
import sys as _sys
9696
import textwrap as _textwrap
9797

98+
9899
def _(s):
99100
return s
100101

102+
101103
try:
102104
_set = set
103105
except NameError:
@@ -123,6 +125,7 @@ def _sorted(iterable, reverse=False):
123125
def _callable(obj):
124126
return hasattr(obj, '__call__') or hasattr(obj, '__bases__')
125127

128+
126129
# silence Python 2.6 buggy warnings about Exception.message
127130
if _sys.version_info[:2] == (2, 6):
128131
import warnings
@@ -145,6 +148,7 @@ def _callable(obj):
145148
# Utility functions and classes
146149
# =============================
147150

151+
148152
class _AttributeHolder(object):
149153
"""Abstract base class that provides __repr__.
150154
@@ -1165,6 +1169,7 @@ def __repr__(self):
11651169
# Optional and Positional Parsing
11661170
# ===========================
11671171

1172+
11681173
class Namespace(_AttributeHolder):
11691174
"""Simple object for storing attributes.
11701175
@@ -1265,7 +1270,6 @@ def get_default(self, dest):
12651270
return action.default
12661271
return self._defaults.get(dest, None)
12671272

1268-
12691273
# =======================
12701274
# Adding argument actions
12711275
# =======================

pythonforandroid/bootstraps/sdl2/build/build.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def make_package(args):
296296
if args.intent_filters:
297297
with open(args.intent_filters) as fd:
298298
args.intent_filters = fd.read()
299-
299+
300300
args.add_activity = args.add_activity or []
301301

302302
args.activity_launch_mode = args.activity_launch_mode or ''
@@ -355,7 +355,6 @@ def make_package(args):
355355
key=LooseVersion)
356356
build_tools_version = build_tools_versions[-1]
357357

358-
359358
render(
360359
'AndroidManifest.tmpl.xml',
361360
'src/main/AndroidManifest.xml',
@@ -371,7 +370,6 @@ def make_package(args):
371370
remove('AndroidManifest.xml')
372371
shutil.copy(join('src', 'main', 'AndroidManifest.xml'),
373372
'AndroidManifest.xml')
374-
375373

376374
render(
377375
'strings.tmpl.xml',
@@ -402,13 +400,13 @@ def make_package(args):
402400
'custom_rules.xml',
403401
args=args)
404402

405-
406403
if args.sign:
407404
render('build.properties', 'build.properties')
408405
else:
409406
if exists('build.properties'):
410407
os.remove('build.properties')
411408

409+
412410
def parse_args(args=None):
413411
global BLACKLIST_PATTERNS, WHITELIST_PATTERNS, PYTHON
414412
default_android_api = 12

pythonforandroid/bootstraps/service_only/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ def run_distribute(self):
114114
site_packages_dir = join(abspath(curdir),
115115
site_packages_dir)
116116

117-
118117
self.strip_libraries(arch)
119118
self.fry_eggs(site_packages_dir)
120119
super(ServiceOnlyBootstrap, self).run_distribute()

pythonforandroid/bootstraps/service_only/build/build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
environment = jinja2.Environment(loader=jinja2.FileSystemLoader(
5454
join(curdir, 'templates')))
5555

56+
5657
def render(template, dest, **kwargs):
5758
'''Using jinja2, render `template` to the filename `dest`, supplying the
5859
@@ -104,6 +105,7 @@ def listfiles(d):
104105
for fn in listfiles(subdir):
105106
yield fn
106107

108+
107109
def make_python_zip():
108110
'''
109111
Search for all the python related files, and construct the pythonXX.zip
@@ -120,7 +122,6 @@ def make_python_zip():
120122
global python_files
121123
d = realpath(join('private', 'lib', 'python2.7'))
122124

123-
124125
def select(fn):
125126
if is_blacklist(fn):
126127
return False
@@ -147,6 +148,7 @@ def select(fn):
147148
zf.write(fn, afn)
148149
zf.close()
149150

151+
150152
def make_tar(tfn, source_dirs, ignore_path=[]):
151153
'''
152154
Make a zip file `fn` from the contents of source_dis.
@@ -242,7 +244,6 @@ def make_package(args):
242244
# if args.dir:
243245
# make_tar('assets/public.mp3', [args.dir], args.ignore_path)
244246

245-
246247
# # Build.
247248
# try:
248249
# for arg in args.command:
@@ -252,7 +253,6 @@ def make_package(args):
252253
# print 'Did you install ant on your system ?'
253254
# sys.exit(-1)
254255

255-
256256
# Prepare some variables for templating process
257257

258258
# default_icon = 'templates/kivy-icon.png'

pythonforandroid/bootstraps/webview/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import glob
55
import sh
66

7+
78
class WebViewBootstrap(Bootstrap):
89
name = 'webview'
910

@@ -59,7 +60,7 @@ def run_distribute(self):
5960

6061
if exists(join('libs', arch.arch, 'libpymodules.so')):
6162
shprint(sh.mv, join('libs', arch.arch, 'libpymodules.so'), 'private/')
62-
shprint(sh.cp, join('python-install', 'include' , 'python2.7', 'pyconfig.h'), join('private', 'include', 'python2.7/'))
63+
shprint(sh.cp, join('python-install', 'include', 'python2.7', 'pyconfig.h'), join('private', 'include', 'python2.7/'))
6364

6465
info('Removing some unwanted files')
6566
shprint(sh.rm, '-f', join('private', 'lib', 'libpython2.7.so'))
@@ -110,9 +111,9 @@ def run_distribute(self):
110111
site_packages_dir = join(abspath(curdir),
111112
site_packages_dir)
112113

113-
114114
self.strip_libraries(arch)
115115
self.fry_eggs(site_packages_dir)
116116
super(WebViewBootstrap, self).run_distribute()
117117

118+
118119
bootstrap = WebViewBootstrap()

pythonforandroid/bootstraps/webview/build/build.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# pyc/py
4040
'*.pyc',
41-
# '*.py',
41+
# '*.py',
4242

4343
# temp files
4444
'~',
@@ -54,6 +54,7 @@
5454
environment = jinja2.Environment(loader=jinja2.FileSystemLoader(
5555
join(curdir, 'templates')))
5656

57+
5758
def render(template, dest, **kwargs):
5859
'''Using jinja2, render `template` to the filename `dest`, supplying the
5960
@@ -105,6 +106,7 @@ def listfiles(d):
105106
for fn in listfiles(subdir):
106107
yield fn
107108

109+
108110
def make_python_zip():
109111
'''
110112
Search for all the python related files, and construct the pythonXX.zip
@@ -121,7 +123,6 @@ def make_python_zip():
121123
global python_files
122124
d = realpath(join('private', 'lib', 'python2.7'))
123125

124-
125126
def select(fn):
126127
if is_blacklist(fn):
127128
return False
@@ -148,6 +149,7 @@ def select(fn):
148149
zf.write(fn, afn)
149150
zf.close()
150151

152+
151153
def make_tar(tfn, source_dirs, ignore_path=[]):
152154
'''
153155
Make a zip file `fn` from the contents of source_dis.
@@ -244,7 +246,6 @@ def make_package(args):
244246
# if args.dir:
245247
# make_tar('assets/public.mp3', [args.dir], args.ignore_path)
246248

247-
248249
# # Build.
249250
# try:
250251
# for arg in args.command:
@@ -254,7 +255,6 @@ def make_package(args):
254255
# print 'Did you install ant on your system ?'
255256
# sys.exit(-1)
256257

257-
258258
# Prepare some variables for templating process
259259

260260
default_icon = 'templates/kivy-icon.png'

0 commit comments

Comments
 (0)