8000 Fixes linter F821 (undefined name) by AndreMiras · Pull Request #1285 · kivy/python-for-android · GitHub
[go: up one dir, main page]

Skip to content

Fixes linter F821 (undefined name) #1285

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

Merged
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
3 changes: 1 addition & 2 deletions pythonforandroid/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging
import os
import re
Expand All @@ -16,7 +15,7 @@
stderr = codecs.getwriter('utf8')(stderr)

if six.PY2:
unistr = unicode
unistr = unicode # noqa F821
else:
unistr = str

Expand Down
4 changes: 2 additions & 2 deletions pythonforandroid/recipes/android/src/android/mixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ def __init__(self, what):
self.serial = str(sound_serial)
sound_serial += 1

if isinstance(what, file):
if isinstance(what, file): # noqa F821
self.file = what
else:
self.file = file(os.path.abspath(what), "rb")
self.file = file(os.path.abspath(what), "rb") # noqa F821

sounds[self.serial] = self

Expand Down
24 changes: 1 addition & 23 deletions pythonforandroid/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@

IS_PY3 = sys.version_info[0] >= 3

if IS_PY3:
unistr = str
else:
unistr = unicode


class WgetDownloader(FancyURLopener):
version = ('Wget/1.17.1')
Expand Down Expand Up @@ -106,7 +101,7 @@ def sync(self):
json.dump(self.data, fd, ensure_ascii=False)
else:
with io.open(self.filename, 'w', encoding='utf-8') as fd:
fd.write(unicode(json.dumps(self.data, ensure_ascii=False)))
fd.write(unicode(json.dumps(self.data, ensure_ascii=False))) # noqa F821


def which(program, path_env):
Expand All @@ -128,20 +123,3 @@ def is_exe(fpath):
return exe_file

return None


def get_directory(filename):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code

'''If the filename ends with a recognised file extension, return the
filename without this extension.'''
if filename.endswith('.tar.gz'):
return basename(filename[:-7])
elif filename.endswith('.tgz'):
return basename(filename[:-4])
elif filename.endswith('.tar.bz2'):
return basename(filename[:-8])
elif filename.endswith('.tbz2'):
return basename(filename[:-5])
elif filename.endswith('.zip'):
return basename(filename[:-4])
info('Unknown file extension for {}'.format(filename))
exit(1)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ ignore =
E111, E114, E115, E116, E202, E121, E123, E124, E225, E126, E127, E128,
E129, E201, E203, E221, E226, E231, E241, E251, E261, E265, E266, E271,
E302, E303, E305, E401, E402, E501, E502, E703, E722, E741, F403,
F812, F821, F841, F811, W291, W292, W293, W391, W503
F812, F841, F811, W291, W292, W293, W391, W503
0