Remove unused variables.

pull/1810/head
Elliott Sales de Andrade 8 years ago
parent e66465369d
commit ea636fcd51
  1. 17
      mesonbuild/backend/ninjabackend.py
  2. 10
      mesonbuild/build.py
  3. 1
      mesonbuild/dependencies/misc.py
  4. 2
      mesonbuild/mconf.py
  5. 2
      mesonbuild/modules/gnome.py
  6. 6
      mesonbuild/scripts/delwithsuffix.py
  7. 2
      mesonbuild/scripts/meson_install.py
  8. 1
      mesonbuild/wrap/wrap.py
  9. 20
      mesontest.py
  10. 1
      run_project_tests.py
  11. 1
      run_unittests.py

@ -315,14 +315,14 @@ int dummy;
# Now we handle the following languages:
# ObjC++, ObjC, C++, C, D, Fortran, Vala
# Pre-existing target C/C++ sources to be built; dict of full path to
# source relative to build root and the original File object.
target_sources = OrderedDict()
# GeneratedList and CustomTarget sources to be built; dict of the full
# path to source relative to build root and the generating target/list
generated_sources = OrderedDict()
# Array of sources generated by valac that have to be compiled
vala_generated_sources = []
# target_sources:
# Pre-existing target C/C++ sources to be built; dict of full path to
# source relative to build root and the original File object.
# generated_sources:
# GeneratedList and CustomTarget sources to be built; dict of the full
# path to source relative to build root and the generating target/list
# vala_generated_sources:
# Array of sources generated by valac that have to be compiled
if 'vala' in target.compilers:
# Sources consumed by valac are filtered out. These only contain
# C/C++ sources, objects, generated libs, and unknown sources now.
@ -331,6 +331,7 @@ int dummy;
else:
target_sources = self.get_target_sources(target)
generated_sources = self.get_target_generated_sources(target)
vala_generated_sources = []
self.scan_fortran_module_outputs(target)
# Generate rules for GeneratedLists
self.generate_generator_list_rules(target, outfile)

@ -227,8 +227,6 @@ class ExtractedObjects:
'You can only extract all the object files at once.'
raise MesonException(msg)
def get_want_all_objects(self):
return self.want_all_objects
class EnvironmentVariables:
def __init__(self):
@ -238,7 +236,7 @@ class EnvironmentVariables:
repr_str = "<{0}: {1}>"
return repr_str.format(self.__class__.__name__, self.envvars)
def get_value(self, name, values, kwargs):
def get_value(self, values, kwargs):
separator = kwargs.get('separator', os.pathsep)
value = ''
@ -247,16 +245,16 @@ class EnvironmentVariables:
return separator, value.strip(separator)
def set(self, env, name, values, kwargs):
return self.get_value(name, values, kwargs)[1]
return self.get_value(values, kwargs)[1]
def append(self, env, name, values, kwargs):
sep, value = self.get_value(name, values, kwargs)
sep, value = self.get_value(values, kwargs)
if name in env:
return env[name] + sep + value
return value
def prepend(self, env, name, values, kwargs):
sep, value = self.get_value(name, values, kwargs)
sep, value = self.get_value(values, kwargs)
if name in env:
return value + sep + env[name]

@ -95,7 +95,6 @@ class BoostDependency(Dependency):
def get_compile_args(self):
args = []
include_dir = ''
if self.boost_root is not None:
if mesonlib.is_windows():
include_dir = self.boost_root

@ -61,7 +61,7 @@ class Conf:
len_name = longest_name = len(titles['name'])
len_descr = longest_descr = len(titles['descr'])
len_value = longest_value = len(titles['value'])
len_choices = longest_choices = 0 # not printed if we don't get any optional values
longest_choices = 0 # not printed if we don't get any optional values
# calculate the max length of each
for x in arr:

@ -730,7 +730,7 @@ class GnomeModule(ExtensionModule):
return args
def gtkdoc_html_dir(self, state, args, kwarga):
def gtkdoc_html_dir(self, state, args, kwargs):
if len(args) != 1:
raise MesonException('Must have exactly one argument.')
modulename = args[0]

@ -15,12 +15,12 @@
import os, sys
def run(args):
if len(sys.argv) != 3:
if len(args) != 2:
print('delwithsuffix.py <root of subdir to process> <suffix to delete>')
sys.exit(1)
topdir = sys.argv[1]
suffix = sys.argv[2]
topdir = args[0]
suffix = args[1]
if suffix[0] != '.':
suffix = '.' + suffix

@ -34,7 +34,7 @@ def set_mode(path, mode):
except PermissionError as e:
msg = '{!r}: Unable to set owner {!r} and group {!r}: {}, ignoring...'
print(msg.format(path, mode.owner, mode.group, e.strerror))
except LookupError as e:
except LookupError:
msg = '{!r}: Non-existent owner {!r} or group {!r}: ignoring...'
print(msg.format(path, mode.owner, mode.group))
except OSError as e:

@ -178,7 +178,6 @@ class Resolver:
if is_there:
try:
subprocess.check_call(['git', 'rev-parse'], cwd=checkoutdir)
is_there = True
except subprocess.CalledProcessError:
raise RuntimeError('%s is not empty but is not a valid '
'git repository, we can not work with it'

@ -304,7 +304,7 @@ class TestHarness:
if jsonlogfile:
write_json_log(jsonlogfile, name, result)
def print_summary(self, logfile, jsonlogfile):
def print_summary(self, logfile):
msg = '''
OK: %4d
FAIL: %4d
@ -446,7 +446,7 @@ TIMEOUT: %4d
assert(isinstance(wrap, list))
return wrap
def get_pretty_suite(self, test, tests):
def get_pretty_suite(self, test):
if len(self.suites) > 1:
rv = TestHarness.split_suite_string(test.suite[0])[0]
s = "+".join(TestHarness.split_suite_string(s)[1] for s in test.suite)
@ -466,15 +466,15 @@ TIMEOUT: %4d
(logfile, logfilename, jsonlogfile, jsonlogfilename) = self.open_log_files()
wrap = self.get_wrapper()
for i in range(self.options.repeat):
for _ in range(self.options.repeat):
for i, test in enumerate(tests):
visible_name = self.get_pretty_suite(test, tests)
visible_name = self.get_pretty_suite(test)
if self.options.gdb:
test.timeout = None
if not test.is_parallel or self.options.gdb:
self.drain_futures(futures, logfile, jsonlogfile)
self.drain_futures(futures)
futures = []
res = self.run_single_test(wrap, test)
self.print_stats(numlen, tests, visible_name, res, i, logfile, jsonlogfile)
@ -488,8 +488,8 @@ TIMEOUT: %4d
if self.options.repeat > 1 and self.fail_count:
break
self.drain_futures(futures, logfile, jsonlogfile)
self.print_summary(logfile, jsonlogfile)
self.drain_futures(futures)
self.print_summary(logfile)
self.print_collected_logs()
if logfilename:
@ -500,7 +500,7 @@ TIMEOUT: %4d
if logfile:
logfile.close()
def drain_futures(self, futures, logfile, jsonlogfile):
def drain_futures(self, futures):
for i in futures:
(result, numlen, tests, name, i, logfile, jsonlogfile) = i
if self.options.repeat > 1 and self.fail_count:
@ -525,7 +525,7 @@ TIMEOUT: %4d
def list_tests(th):
tests = th.get_tests()
for t in tests:
print(th.get_pretty_suite(t, tests))
print(th.get_pretty_suite(t))
def merge_suite_options(options):
buildfile = os.path.join(options.wd, 'meson-private/build.dat')
@ -558,7 +558,7 @@ def rebuild_all(wd):
return False
p = subprocess.Popen([ninja, '-C', wd])
(stdo, stde) = p.communicate()
p.communicate()
if p.returncode != 0:
print("Could not rebuild")

@ -217,7 +217,6 @@ def validate_install(srcdir, installdir, compiler):
# If this exists, the test does not install any other files
noinst_file = 'usr/no-installed-files'
expected = {}
found = {}
ret_msg = ''
# Generate list of expected files
if os.path.exists(os.path.join(installdir, noinst_file)):

@ -852,7 +852,6 @@ class AllPlatformTests(BasePlatformTests):
env = Environment(testdir, self.builddir, self.meson_command,
get_fake_options(self.prefix), [])
for lang, evar in langs:
evalue = None
# Detect with evar and do sanity checks on that
if evar in os.environ:
ecc = getattr(env, 'detect_{}_compiler'.format(lang))(False)

Loading…
Cancel
Save