Skip to content

Commit 3d7838f

Browse files
committed
Fixes linter F401 (unused imports)
This change may introduce regressions since some recipes were importing from wrong module. e.g. importing from `pythonforandroid.toolchain` rather than from `pythonforandroid.recipe` and `pythonforandroid.toolchain` has a lot of apparently "unused" imports.
1 parent 54a444b commit 3d7838f

File tree

98 files changed

+133
-189
lines changed

Some content is hidden

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

98 files changed

+133
-189
lines changed

pythonforandroid/bdistapk.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import print_function
22
from setuptools import Command
3-
from pythonforandroid import toolchain
43

54
import sys
65
from os.path import realpath, join, exists, dirname, curdir, basename, split

pythonforandroid/bootstrap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from os.path import (join, dirname, isdir, splitext, basename, realpath)
2-
from os import listdir, mkdir
1+
from os.path import (join, dirname, isdir, splitext, basename)
2+
from os import listdir
33
import sh
44
import glob
55
import json
66
import importlib
77

88
from pythonforandroid.logger import (warning, shprint, info, logger,
9-
debug, error)
9+
debug)
1010
from pythonforandroid.util import (current_directory, ensure_dir,
1111
temp_directory, which)
1212
from pythonforandroid.recipe import Recipe

pythonforandroid/bootstraps/empty/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
from pythonforandroid.toolchain import Bootstrap
2-
from os.path import join, exists
3-
from os import walk
4-
import glob
5-
import sh
62

73

84
class EmptyBootstrap(Bootstrap):

pythonforandroid/bootstraps/pygame/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchARM, info_main
1+
from pythonforandroid.toolchain import Bootstrap, current_directory, info, info_main, shprint
22
from os.path import join, exists
33
from os import walk
44
import glob

pythonforandroid/bootstraps/service_only/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from os import walk
33
from os.path import join, exists, curdir, abspath
44
import sh
5-
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchARM, info_main
5+
from pythonforandroid.toolchain import Bootstrap, current_directory, info, info_main, shprint
66

77

88
class ServiceOnlyBootstrap(Bootstrap):

pythonforandroid/bootstraps/service_only/build/build.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
from os import makedirs
77
import os
88
import tarfile
9-
import time
109
import subprocess
1110
import shutil
1211
from zipfile import ZipFile
1312
import sys
14-
import re
1513
import shlex
1614

1715
from fnmatch import fnmatch

pythonforandroid/bootstraps/webview/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchARM, info_main
1+
from pythonforandroid.toolchain import Bootstrap, current_directory, info, info_main, shprint
22
from os.path import join, exists, curdir, abspath
33
from os import walk
44
import glob

pythonforandroid/build.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from os.path import (join, realpath, dirname, expanduser, exists,
44
split, isdir)
5-
from os import environ, listdir
5+
from os import environ
66
import os
77
import glob
88
import sys
@@ -11,9 +11,8 @@
1111

1212
from pythonforandroid.util import (ensure_dir, current_directory)
1313
from pythonforandroid.logger import (info, warning, error, info_notify,
14-
Err_Fore, Err_Style, info_main,
15-
shprint)
16-
from pythonforandroid.archs import ArchARM, ArchARMv7_a, Archx86, Archx86_64, ArchAarch_64
14+
Err_Fore, info_main, shprint)
15+
from pythonforandroid.archs import ArchARM, ArchARMv7_a, ArchAarch_64, Archx86
1716
from pythonforandroid.recipe import Recipe
1817

1918
DEFAULT_ANDROID_API = 15
@@ -382,7 +381,7 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
382381

383382
toolchain_versions = []
384383
toolchain_path = join(self.ndk_dir, 'toolchains')
385-
if os.path.isdir(toolchain_path):
384+
if isdir(toolchain_path):
386385
toolchain_contents = glob.glob('{}/{}-*'.format(toolchain_path,
387386
toolchain_prefix))
388387
toolchain_versions = [split(path)[-1][len(toolchain_prefix) + 1:]

pythonforandroid/recipe.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from os.path import join, dirname, isdir, exists, isfile, split, realpath, basename
1+
from os.path import basename, dirname, exists, isdir, isfile, join, realpath
22
import importlib
3-
import zipfile
43
import glob
54
from shutil import rmtree
65
from six import PY2, with_metaclass
@@ -21,7 +20,6 @@
2120
from pythonforandroid.util import (urlretrieve, current_directory, ensure_dir)
2221

2322
# this import is necessary to keep imp.load_source from complaining :)
24-
import pythonforandroid.recipes
2523

2624

2725
if PY2:

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

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

77
# legacy import
8-
from android._android import *

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from jnius import PythonJavaClass, java_method, autoclass, cast
1+
from jnius import PythonJavaClass, autoclass, java_method
22
from android.config import JAVA_NAMESPACE, JNI_NAMESPACE
33

44
_activity = autoclass(JAVA_NAMESPACE + '.PythonActivity').mActivity

pythonforandroid/recipes/android/src/android/billing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
55
'''
66

7-
from android._android_billing import *

pythonforandroid/recipes/apsw/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from pythonforandroid.toolchain import PythonRecipe, shprint, shutil, current_directory
2-
from os.path import join, exists
1+
from pythonforandroid.recipe import PythonRecipe
2+
from pythonforandroid.toolchain import current_directory, shprint
33
import sh
44

5+
56
class ApswRecipe(PythonRecipe):
67
version = '3.15.0-r1'
78
url = 'https://github.com/rogerbinns/apsw/archive/{version}.tar.gz'

pythonforandroid/recipes/audiostream/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

2-
from pythonforandroid.toolchain import CythonRecipe, shprint, current_directory, info
3-
import sh
4-
import glob
5-
from os.path import join, exists
2+
from pythonforandroid.recipe import CythonRecipe
3+
from os.path import join
64

75

86
class AudiostreamRecipe(CythonRecipe):

pythonforandroid/recipes/cdecimal/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
from pythonforandroid.toolchain import CompiledComponentsPythonRecipe
1+
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
32
from pythonforandroid.patching import is_darwin
43

54

pythonforandroid/recipes/cherrypy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import PythonRecipe
1+
from pythonforandroid.recipe import PythonRecipe
22

33
class CherryPyRecipe(PythonRecipe):
44
version = '5.1.0'

pythonforandroid/recipes/coverage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import PythonRecipe
1+
from pythonforandroid.recipe import PythonRecipe
22

33

44
class CoverageRecipe(PythonRecipe):

pythonforandroid/recipes/cryptography/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
2-
from os.path import dirname, join
2+
from os.path import join
33

44
class CryptographyRecipe(CompiledComponentsPythonRecipe):
55
name = 'cryptography'

pythonforandroid/recipes/cymunk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import CythonRecipe
1+
from pythonforandroid.recipe import CythonRecipe
22

33

44
class CymunkRecipe(CythonRecipe):

pythonforandroid/recipes/decorator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import PythonRecipe
1+
from pythonforandroid.recipe import PythonRecipe
22

33
class DecoratorPyRecipe(PythonRecipe):
44
version = '4.0.9'

pythonforandroid/recipes/enum34/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import PythonRecipe
1+
from pythonforandroid.recipe import PythonRecipe
22

33
class Enum34Recipe(PythonRecipe):
44
version = '1.1.3'

pythonforandroid/recipes/feedparser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import PythonRecipe
1+
from pythonforandroid.recipe import PythonRecipe
22

33
class FeedparserPyRecipe(PythonRecipe):
44
version = '5.2.1'

pythonforandroid/recipes/ffmpeg/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
from pythonforandroid.toolchain import Recipe, shprint, current_directory, ArchARM
1+
from pythonforandroid.toolchain import Recipe, current_directory, shprint
22
from os.path import exists, join, realpath
3-
from os import uname
4-
import glob
53
import sh
6-
import os
7-
import shutil
84

95

106
class FFMpegRecipe(Recipe):

pythonforandroid/recipes/ffpyplayer/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
from pythonforandroid.toolchain import Recipe, CythonRecipe, shprint, current_directory, ArchARM
2-
from os.path import exists, join, realpath
3-
from os import uname
4-
import glob
5-
import sh
6-
import os
1+
from pythonforandroid.recipe import CythonRecipe
2+
from pythonforandroid.toolchain import Recipe
3+
from os.path import join
74

85

96
class FFPyPlayerRecipe(CythonRecipe):

pythonforandroid/recipes/flask/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

2-
from pythonforandroid.toolchain import PythonRecipe, shprint
3-
import sh
2+
from pythonforandroid.recipe import PythonRecipe
43

54

65
class FlaskRecipe(PythonRecipe):

pythonforandroid/recipes/fontconfig/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
2-
from pythonforandroid.toolchain import BootstrapNDKRecipe, shprint, current_directory, info_main
3-
from os.path import exists, join
1+
from pythonforandroid.recipe import BootstrapNDKRecipe
2+
from pythonforandroid.toolchain import current_directory, shprint
43
import sh
54

65

7-
8-
96
class FontconfigRecipe(BootstrapNDKRecipe):
107
version = "really_old"
118
url = 'https://github.com/vault/fontconfig/archive/androidbuild.zip'

pythonforandroid/recipes/freetype/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

2-
from pythonforandroid.toolchain import Recipe, shprint, current_directory, ArchARM
2+
from pythonforandroid.toolchain import Recipe, current_directory, shprint
33
from os.path import exists, join, realpath
4-
from os import uname
5-
import glob
64
import sh
75

86
class FreetypeRecipe(Recipe):

pythonforandroid/recipes/genericndkbuild/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from pythonforandroid.toolchain import BootstrapNDKRecipe, shprint, current_directory, info
2-
from os.path import exists, join
1+
from pythonforandroid.recipe import BootstrapNDKRecipe
2+
from pythonforandroid.toolchain import current_directory, shprint
33
import sh
44

55

pythonforandroid/recipes/gevent-websocket/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import PythonRecipe
1+
from pythonforandroid.recipe import PythonRecipe
22

33

44
class GeventWebsocketRecipe(PythonRecipe):

pythonforandroid/recipes/gevent/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
from pythonforandroid.toolchain import CompiledComponentsPythonRecipe
2+
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
33

44

55
class GeventRecipe(CompiledComponentsPythonRecipe):

pythonforandroid/recipes/greenlet/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import PythonRecipe
1+
from pythonforandroid.recipe import PythonRecipe
22

33

44
class GreenletRecipe(PythonRecipe):

pythonforandroid/recipes/harfbuzz/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

2-
from pythonforandroid.toolchain import Recipe, shprint, current_directory, ArchARM
3-
from os.path import exists, join, realpath
4-
from os import uname
5-
import glob
2+
from pythonforandroid.toolchain import Recipe, current_directory, shprint
3+
from os.path import exists, join
64
import sh
75

86

pythonforandroid/recipes/hostpython2/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
from pythonforandroid.toolchain import Recipe, shprint, current_directory, info, warning
33
from os.path import join, exists
4-
from os import chdir
54
import os
65
import sh
76

pythonforandroid/recipes/icu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from os.path import join, isdir
44
from pythonforandroid.recipe import NDKRecipe
5-
from pythonforandroid.toolchain import shprint, info
5+
from pythonforandroid.toolchain import shprint
66
from pythonforandroid.util import current_directory, ensure_dir
77

88

pythonforandroid/recipes/ifaddrs/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from os.path import join, exists
44
import sh
55
from pythonforandroid.logger import info, shprint
6+
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
7+
from pythonforandroid.toolchain import current_directory
68

7-
from pythonforandroid.toolchain import (CompiledComponentsPythonRecipe,
8-
current_directory)
99

1010
class IFAddrRecipe(CompiledComponentsPythonRecipe):
1111
version = 'master'

pythonforandroid/recipes/jedi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from pythonforandroid.toolchain import PythonRecipe
2+
from pythonforandroid.recipe import PythonRecipe
33

44

55
class JediRecipe(PythonRecipe):

pythonforandroid/recipes/kivent_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import CythonRecipe
1+
from pythonforandroid.recipe import CythonRecipe
22
from os.path import join
33

44

pythonforandroid/recipes/kivent_cymunk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import CythonRecipe
1+
from pythonforandroid.recipe import CythonRecipe
22
from os.path import join
33

44

pythonforandroid/recipes/kivent_particles/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import CythonRecipe
1+
from pythonforandroid.recipe import CythonRecipe
22
from os.path import join
33

44

pythonforandroid/recipes/kivent_polygen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import CythonRecipe
1+
from pythonforandroid.recipe import CythonRecipe
22
from os.path import join
33

44

pythonforandroid/recipes/kivy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2-
from pythonforandroid.toolchain import CythonRecipe, shprint, current_directory, ArchARM
1+
from pythonforandroid.recipe import CythonRecipe
2+
from pythonforandroid.toolchain import current_directory, shprint
33
from os.path import exists, join, basename
44
import sh
55
import glob

pythonforandroid/recipes/leveldb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pythonforandroid.toolchain import Recipe, shprint, shutil, current_directory
2-
from os.path import join, exists
2+
from os.path import join
33
import sh
44

55
class LevelDBRecipe(Recipe):

pythonforandroid/recipes/libcurl/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sh
22
from pythonforandroid.toolchain import Recipe, shprint, shutil, current_directory
3-
from pythonforandroid.util import ensure_dir
4-
from os.path import exists, join, abspath
3+
from os.path import exists, join
54
from multiprocessing import cpu_count
65

76

pythonforandroid/recipes/libgeos/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pythonforandroid.toolchain import Recipe, shprint, shutil, current_directory
2-
from pythonforandroid.util import ensure_dir
3-
from os.path import exists, join, abspath
2+
from os.path import exists, join
43
import sh
54
from multiprocessing import cpu_count
65

0 commit comments

Comments
 (0)