diff options
author | Sergio Ahumada <sahumada@blackberry.com> | 2015-02-14 11:26:46 +0100 |
---|---|---|
committer | Sergio Ahumada <sahumada@texla.cl> | 2015-03-10 12:28:45 +0000 |
commit | 3cde3fb39489e8e9b4319d69031f27a2d113cc39 (patch) | |
tree | b887d6c0741e6edc5f70e2516fcf00b49a0e9db5 /packaging-tools/create_installer.py | |
parent | a2f7d382886120158329dba152c23b523159b938 (diff) |
Clean up unused variables and imports
* remove unused imports
* remove unused variables
* replace unused variables with 'dummy', this is the suggested and
most common way to deal with variables that need to be defined
but are never used and it also makes pylint not to complain, eg:
for root, dir, files in os.walk(directory):
for basename in files:
if fnmatch.fnmatch(basename, '*.pro'):
filename = os.path.join(root, basename)
since 'dirs' is never used, we replace it with 'dummy'
for root, dummy, files in os.walk(directory):
for basename in files:
if fnmatch.fnmatch(basename, '*.pro'):
filename = os.path.join(root, basename)
Change-Id: I850c2c2a8ae60035d0cc5bf6c3429ff8640f9f11
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Diffstat (limited to 'packaging-tools/create_installer.py')
-rw-r--r-- | packaging-tools/create_installer.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/packaging-tools/create_installer.py b/packaging-tools/create_installer.py index d466bb954..5b1e7658b 100644 --- a/packaging-tools/create_installer.py +++ b/packaging-tools/create_installer.py @@ -340,7 +340,7 @@ def parse_cmd_line(): if arg_count < 2: return False setup_option_parser() - (options, args) = OPTION_PARSER.parse_args() + (options, dummy) = OPTION_PARSER.parse_args() global MAIN_CONFIG_NAME global DEVELOPMENT_MODE @@ -617,7 +617,7 @@ def substitute_global_tags(): # initialize the file list fileslist = [] for directory in GENERAL_TAG_SUBST_LIST: - for root, dirs, files in os.walk(directory): + for root, dummy, files in os.walk(directory): for name in files: path = os.path.join(root, name) fileslist.append(path) @@ -639,7 +639,7 @@ def substitute_component_tags(tag_pair_list, meta_dir_dest): # initialize the file list fileslist = [] - for root, dirs, files in os.walk(meta_dir_dest): + for root, dummy, files in os.walk(meta_dir_dest): for name in files: path = os.path.join(root, name) fileslist.append(path) @@ -951,7 +951,7 @@ def qml_examples_only(examples_dir): return subdir_list = [] regex = re.compile('^qml\S.*') - for root, dirs, files in os.walk(examples_dir): + for root, dirs, dummy in os.walk(examples_dir): for basename in dirs: if regex.search(basename): root_dir = root @@ -1040,7 +1040,6 @@ def install_ifw_tools(): tools_dir_temp = bld_ifw_tools.build_ifw(options) tools_bin_path = SCRIPT_ROOT_DIR + os.sep + tools_dir_temp elif not os.path.exists(IFW_TOOLS_DIR): - tools_dir_name = os.path.normpath(IFW_TOOLS_DIR_NAME) if INSTALLER_FRAMEWORK_TOOLS: package_url = INSTALLER_FRAMEWORK_TOOLS else: |