Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fixes flake8 errors post update #2191

Merged
merged 1 commit into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pythonforandroid/archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def get_env(self, with_flags_in_cc=True):
+ " ".join(
[
"-L'"
+ l.replace("'", "'\"'\"'")
+ link_path.replace("'", "'\"'\"'")
+ "'" # no shlex.quote in py2
for l in self.extra_global_link_paths
for link_path in self.extra_global_link_paths
]
)
+ ' ' + ' '.join(self.common_ldflags).format(
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def find_order(graph):
'''
while graph:
# Find all items without a parent
leftmost = [l for l, s in graph.items() if not s]
leftmost = [name for name, dep in graph.items() if not dep]
if not leftmost:
raise ValueError('Dependency cycle detected! %s' % graph)
# If there is more than one, sort them for predictable order
Expand Down
4 changes: 2 additions & 2 deletions pythonforandroid/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ def printtail(out, name, forecolor, tail_n=0,
re_filter_in=None, re_filter_out=None):
lines = out.splitlines()
if re_filter_in is not None:
lines = [l for l in lines if re_filter_in.search(l)]
lines = [line for line in lines if re_filter_in.search(line)]
if re_filter_out is not None:
lines = [l for l in lines if not re_filter_out.search(l)]
lines = [line for line in lines if not re_filter_out.search(line)]
if tail_n == 0 or len(lines) <= tail_n:
info('{}:\n{}\t{}{}'.format(
name, forecolor, '\t\n'.join(lines), Out_Fore.RESET))
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/pythonpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def get_package_dependencies(package,
new_reqs = set()
if verbose:
print("get_package_dependencies: resolving dependency "
"to package name: ".format(package_dep))
f"to package name: {package_dep}")
package = get_package_name(package_dep)
if package.lower() in packages_processed:
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def find_library(name):
lib_search_dirs.insert(0, lib_dir_2)

# Now scan the lib dirs:
for lib_dir in [l for l in lib_search_dirs if os.path.exists(l)]:
for lib_dir in [ldir for ldir in lib_search_dirs if os.path.exists(ldir)]:
filelist = [
f for f in os.listdir(lib_dir)
if does_libname_match_filename(name, f)
Expand Down
6 changes: 3 additions & 3 deletions pythonforandroid/recipes/reportlab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def prebuild_arch(self, arch):
font_dir = os.path.join(recipe_dir,
"src", "reportlab", "fonts")
if os.path.exists(font_dir):
for l in os.listdir(font_dir):
if l.lower().startswith('darkgarden'):
os.remove(os.path.join(font_dir, l))
for file in os.listdir(font_dir):
if file.lower().startswith('darkgarden'):
os.remove(os.path.join(font_dir, file))

# Apply patches:
self.apply_patch('patches/fix-setup.patch', arch.arch)
Expand Down
8 changes: 4 additions & 4 deletions pythonforandroid/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ def build_dist_from_args(ctx, dist, args):
.format(join(ctx.dist_dir, ctx.distribution.dist_dir)))


def split_argument_list(l):
if not len(l):
def split_argument_list(arg_list):
if not len(arg_list):
return []
return re.split(r'[ ,]+', l)
return re.split(r'[ ,]+', arg_list)


class NoAbbrevParser(argparse.ArgumentParser):
Expand Down Expand Up @@ -1144,7 +1144,7 @@ def distributions(self, _args):

if dists:
print('{Style.BRIGHT}Distributions currently installed are:'
'{Style.RESET_ALL}'.format(Style=Out_Style, Fore=Out_Fore))
'{Style.RESET_ALL}'.format(Style=Out_Style))
pretty_log_dists(dists, print)
else:
print('{Style.BRIGHT}There are no dists currently built.'
Expand Down