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 *

0 commit comments

Comments
 (0)