flake8: Perform suggested whitespace/formatting changes

This only touches newlines, spaces, and (occaisionally) commas.  Anything
else is left for another commit.
pull/2357/head
Luke Shumaker 8 years ago
parent 751d59d952
commit bb25260f00
  1. 19
      mesonbuild/backend/ninjabackend.py
  2. 6
      mesonbuild/backend/vs2010backend.py
  3. 2
      mesonbuild/compilers/c.py
  4. 7
      mesonbuild/interpreter.py
  5. 12
      mesonbuild/modules/gnome.py
  6. 6
      mesonbuild/modules/i18n.py
  7. 1
      mesonrewriter.py
  8. 4
      msi/createmsi.py

@ -83,8 +83,7 @@ class NinjaBuildElement:
def write(self, outfile): def write(self, outfile):
self.check_outputs() self.check_outputs()
line = 'build %s: %s %s' % ( line = 'build %s: %s %s' % (' '.join([ninja_quote(i) for i in self.outfilenames]),
' '.join([ninja_quote(i) for i in self.outfilenames]),
self.rule, self.rule,
' '.join([ninja_quote(i) for i in self.infilenames])) ' '.join([ninja_quote(i) for i in self.infilenames]))
if len(self.deps) > 0: if len(self.deps) > 0:
@ -721,8 +720,7 @@ int dummy;
# On toolchains/platforms that use an import library for # On toolchains/platforms that use an import library for
# linking (separate from the shared library with all the # linking (separate from the shared library with all the
# code), we need to install that too (dll.a/.lib). # code), we need to install that too (dll.a/.lib).
if (isinstance(t, build.SharedLibrary) or if (isinstance(t, build.SharedLibrary) or isinstance(t, build.Executable)) and t.get_import_filename():
isinstance(t, build.Executable)) and t.get_import_filename():
if custom_install_dir: if custom_install_dir:
# If the DLL is installed into a custom directory, # If the DLL is installed into a custom directory,
# install the import library into the same place so # install the import library into the same place so
@ -856,7 +854,8 @@ int dummy;
self.create_target_alias('meson-test', outfile) self.create_target_alias('meson-test', outfile)
# And then benchmarks. # And then benchmarks.
cmd = self.environment.get_build_command(True) + ['test', '--benchmark', '--logbase', cmd = self.environment.get_build_command(True) + [
'test', '--benchmark', '--logbase',
'benchmarklog', '--num-processes=1', '--no-rebuild'] 'benchmarklog', '--num-processes=1', '--no-rebuild']
elem = NinjaBuildElement(self.all_outputs, 'meson-benchmark', 'CUSTOM_COMMAND', ['all', 'PHONY']) elem = NinjaBuildElement(self.all_outputs, 'meson-benchmark', 'CUSTOM_COMMAND', ['all', 'PHONY'])
elem.add_item('COMMAND', cmd) elem.add_item('COMMAND', cmd)
@ -1578,7 +1577,8 @@ int dummy;
full_exe = [ninja_quote(x) for x in self.environment.get_build_command()] + [ full_exe = [ninja_quote(x) for x in self.environment.get_build_command()] + [
'--internal', '--internal',
'dirchanger', 'dirchanger',
'$RUNDIR'] '$RUNDIR',
]
invoc = (' '.join(full_exe) + ' ' + invoc = (' '.join(full_exe) + ' ' +
' '.join(ninja_quote(i) for i in compiler.get_exelist())) ' '.join(ninja_quote(i) for i in compiler.get_exelist()))
command = ' command = %s $ARGS $in\n' % invoc command = ' command = %s $ARGS $in\n' % invoc
@ -2527,10 +2527,11 @@ rule FORTRAN_DEP_HACK
def generate_dist(self, outfile): def generate_dist(self, outfile):
elem = NinjaBuildElement(self.all_outputs, 'meson-dist', 'CUSTOM_COMMAND', 'PHONY') elem = NinjaBuildElement(self.all_outputs, 'meson-dist', 'CUSTOM_COMMAND', 'PHONY')
elem.add_item('DESC', 'Creating source packages') elem.add_item('DESC', 'Creating source packages')
elem.add_item('COMMAND', self.environment.get_build_command() + elem.add_item('COMMAND', self.environment.get_build_command() + [
['--internal', 'dist', '--internal', 'dist',
self.environment.source_dir, self.environment.source_dir,
self.environment.build_dir] + self.environment.get_build_command()) self.environment.build_dir,
] + self.environment.get_build_command())
elem.add_item('pool', 'console') elem.add_item('pool', 'console')
elem.write(outfile) elem.write(outfile)
# Alias that runs the target defined above # Alias that runs the target defined above

@ -383,8 +383,7 @@ class Vs2010Backend(backends.Backend):
cmd = [sys.executable, os.path.join(self.environment.get_script_dir(), 'commandrunner.py'), cmd = [sys.executable, os.path.join(self.environment.get_script_dir(), 'commandrunner.py'),
self.environment.get_build_dir(), self.environment.get_build_dir(),
self.environment.get_source_dir(), self.environment.get_source_dir(),
self.get_target_dir(target)] + \ self.get_target_dir(target)] + self.environment.get_build_command()
self.environment.get_build_command()
for i in cmd_raw: for i in cmd_raw:
if isinstance(i, build.BuildTarget): if isinstance(i, build.BuildTarget):
cmd.append(os.path.join(self.environment.get_build_dir(), self.get_target_filename(i))) cmd.append(os.path.join(self.environment.get_build_dir(), self.get_target_filename(i)))
@ -926,8 +925,7 @@ class Vs2010Backend(backends.Backend):
ofile.text = '$(OutDir)%s' % target.get_filename() ofile.text = '$(OutDir)%s' % target.get_filename()
subsys = ET.SubElement(link, 'SubSystem') subsys = ET.SubElement(link, 'SubSystem')
subsys.text = subsystem subsys.text = subsystem
if (isinstance(target, build.SharedLibrary) or if (isinstance(target, build.SharedLibrary) or isinstance(target, build.Executable)) and target.get_import_filename():
isinstance(target, build.Executable)) and target.get_import_filename():
# DLLs built with MSVC always have an import library except when # DLLs built with MSVC always have an import library except when
# they're data-only DLLs, but we don't support those yet. # they're data-only DLLs, but we don't support those yet.
ET.SubElement(link, 'ImportLibrary').text = target.get_import_filename() ET.SubElement(link, 'ImportLibrary').text = target.get_import_filename()

@ -1025,5 +1025,3 @@ class VisualStudioCCompiler(CCompiler):
# and the can not be called. # and the can not be called.
return None return None
return vs32_instruction_set_args.get(instruction_set, None) return vs32_instruction_set_args.get(instruction_set, None)

@ -1028,7 +1028,6 @@ class CompilerHolder(InterpreterObject):
h) h)
return result return result
def first_supported_argument_method(self, args, kwargs): def first_supported_argument_method(self, args, kwargs):
for i in mesonlib.stringlistify(args): for i in mesonlib.stringlistify(args):
if self.compiler.has_argument(i, self.environment): if self.compiler.has_argument(i, self.environment):
@ -1245,7 +1244,8 @@ class MesonMain(InterpreterObject):
pch_kwargs = set(['c_pch', 'cpp_pch']) pch_kwargs = set(['c_pch', 'cpp_pch'])
lang_arg_kwargs = set(['c_args', lang_arg_kwargs = set([
'c_args',
'cpp_args', 'cpp_args',
'd_args', 'd_args',
'd_import_dirs', 'd_import_dirs',
@ -1264,7 +1264,8 @@ vala_kwargs = set(['vala_header', 'vala_gir', 'vala_vapi'])
rust_kwargs = set(['rust_crate_type']) rust_kwargs = set(['rust_crate_type'])
cs_kwargs = set(['resources', 'cs_args']) cs_kwargs = set(['resources', 'cs_args'])
buildtarget_kwargs = set(['build_by_default', buildtarget_kwargs = set([
'build_by_default',
'build_rpath', 'build_rpath',
'dependencies', 'dependencies',
'extra_files', 'extra_files',

@ -697,18 +697,22 @@ This will become a hard error in the future.''')
args.append('--langs=' + '@@'.join(langs)) args.append('--langs=' + '@@'.join(langs))
inscript = build.RunScript(script, args) inscript = build.RunScript(script, args)
potargs = state.environment.get_build_command() + ['--internal', 'yelphelper', 'pot', potargs = state.environment.get_build_command() + [
'--internal', 'yelphelper', 'pot',
'--subdir=' + state.subdir, '--subdir=' + state.subdir,
'--id=' + project_id, '--id=' + project_id,
'--sources=' + source_str] '--sources=' + source_str,
]
pottarget = build.RunTarget('help-' + project_id + '-pot', potargs[0], pottarget = build.RunTarget('help-' + project_id + '-pot', potargs[0],
potargs[1:], [], state.subdir) potargs[1:], [], state.subdir)
poargs = state.environment.get_build_command() + ['--internal', 'yelphelper', 'update-po', poargs = state.environment.get_build_command() + [
'--internal', 'yelphelper', 'update-po',
'--subdir=' + state.subdir, '--subdir=' + state.subdir,
'--id=' + project_id, '--id=' + project_id,
'--sources=' + source_str, '--sources=' + source_str,
'--langs=' + '@@'.join(langs)] '--langs=' + '@@'.join(langs),
]
potarget = build.RunTarget('help-' + project_id + '-update-po', poargs[0], potarget = build.RunTarget('help-' + project_id + '-update-po', poargs[0],
poargs[1:], [], state.subdir) poargs[1:], [], state.subdir)

@ -72,8 +72,10 @@ class I18nModule(ExtensionModule):
datadirs = self._get_data_dirs(state, mesonlib.stringlistify(kwargs.pop('data_dirs', []))) datadirs = self._get_data_dirs(state, mesonlib.stringlistify(kwargs.pop('data_dirs', [])))
datadirs = '--datadirs=' + ':'.join(datadirs) if datadirs else None datadirs = '--datadirs=' + ':'.join(datadirs) if datadirs else None
command = state.environment.get_build_command() + ['--internal', 'msgfmthelper', command = state.environment.get_build_command() + [
'@INPUT@', '@OUTPUT@', file_type, podir] '--internal', 'msgfmthelper',
'@INPUT@', '@OUTPUT@', file_type, podir
]
if datadirs: if datadirs:
command.append(datadirs) command.append(datadirs)

@ -30,4 +30,3 @@ if __name__ == '__main__':
print('Warning: This executable is deprecated. Use "meson rewrite" instead.', print('Warning: This executable is deprecated. Use "meson rewrite" instead.',
file=sys.stderr) file=sys.stderr)
sys.exit(mesonmain.run(['rewrite'] + sys.argv[1:])) sys.exit(mesonmain.run(['rewrite'] + sys.argv[1:]))

@ -139,7 +139,8 @@ class PackageGenerator:
}) })
installdir = ET.SubElement(progfiledir, 'Directory', { installdir = ET.SubElement(progfiledir, 'Directory', {
'Id': 'INSTALLDIR', 'Id': 'INSTALLDIR',
'Name': 'Meson'}) 'Name': 'Meson',
})
ET.SubElement(product, 'Property', { ET.SubElement(product, 'Property', {
'Id': 'WIXUI_INSTALLDIR', 'Id': 'WIXUI_INSTALLDIR',
@ -179,7 +180,6 @@ class PackageGenerator:
'Id': component_id, 'Id': component_id,
}) })
def create_xml(self, nodes, current_dir, parent_xml_node, staging_dir): def create_xml(self, nodes, current_dir, parent_xml_node, staging_dir):
cur_node = nodes[current_dir] cur_node = nodes[current_dir]
if cur_node.files: if cur_node.files:

Loading…
Cancel
Save