Kill end of line whitespace dead.

pull/15/head
Jussi Pakkanen 10 years ago
parent 3e29c4fccb
commit a5863477f8
  1. 4
      build.py
  2. 8
      dependencies.py
  3. 2
      depfixer.py
  4. 8
      environment.py
  5. 40
      interpreter.py
  6. 2
      meson.py
  7. 2
      meson_test.py
  8. 10
      mesongui.py
  9. 4
      mlog.py
  10. 4
      mparser.py
  11. 4
      ninjabackend.py

@ -466,7 +466,7 @@ class Generator():
if not isinstance(a, str): if not isinstance(a, str):
raise InvalidArguments('A non-string object in "arguments" keyword argument.') raise InvalidArguments('A non-string object in "arguments" keyword argument.')
self.arglist = args self.arglist = args
if 'output' not in kwargs: if 'output' not in kwargs:
raise InvalidArguments('Generator must have "output" keyword argument.') raise InvalidArguments('Generator must have "output" keyword argument.')
outputs = kwargs['output'] outputs = kwargs['output']
@ -749,7 +749,7 @@ class ConfigureFile():
def get_sources(self): def get_sources(self):
return self.sources return self.sources
def get_subdir(self): def get_subdir(self):
return self.subdir return self.subdir

@ -388,7 +388,7 @@ class GMockDependency(Dependency):
else: else:
self.sources = [self.all_src] self.sources = [self.all_src]
mlog.log('Dependency GMock found:', mlog.green('YES'), '(building self)') mlog.log('Dependency GMock found:', mlog.green('YES'), '(building self)')
else: else:
mlog.log('Dependency GMock found:', mlog.red('NO')) mlog.log('Dependency GMock found:', mlog.red('NO'))
self.is_found = False self.is_found = False
@ -611,12 +611,12 @@ why. As a hack filter out everything that is not a flag."""
def found(self): def found(self):
return self.args is not None return self.args is not None
def get_compile_args(self): def get_compile_args(self):
if self.args is None: if self.args is None:
return [] return []
return self.args return self.args
def get_link_args(self): def get_link_args(self):
return self.libs return self.libs
@ -629,7 +629,7 @@ class AppleFrameworks(Dependency):
if len(modules) == 0: if len(modules) == 0:
raise DependencyException("AppleFrameworks dependency requires at least one module.") raise DependencyException("AppleFrameworks dependency requires at least one module.")
self.frameworks = modules self.frameworks = modules
def get_link_args(self): def get_link_args(self):
args = [] args = []
for f in self.frameworks: for f in self.frameworks:

@ -105,7 +105,7 @@ class Elf():
self.parse_header() self.parse_header()
self.parse_sections() self.parse_sections()
self.parse_dynamic() self.parse_dynamic()
def detect_elf_type(self): def detect_elf_type(self):
data = self.bf.read(5) data = self.bf.read(5)
if data[1:4] != b'ELF': if data[1:4] != b'ELF':

@ -1290,7 +1290,7 @@ def find_coverage_tools():
gcovr_exe = 'gcovr' gcovr_exe = 'gcovr'
lcov_exe = 'lcov' lcov_exe = 'lcov'
genhtml_exe = 'genhtml' genhtml_exe = 'genhtml'
if not exe_exists([gcovr_exe, '--version']): if not exe_exists([gcovr_exe, '--version']):
gcovr_exe = None gcovr_exe = None
if not exe_exists([lcov_exe, '--version']): if not exe_exists([lcov_exe, '--version']):
@ -1423,7 +1423,7 @@ class Environment():
def get_script_dir(self): def get_script_dir(self):
return os.path.dirname(self.meson_script_file) return os.path.dirname(self.meson_script_file)
def get_log_dir(self): def get_log_dir(self):
return self.log_dir return self.log_dir
@ -1470,7 +1470,7 @@ class Environment():
exe_wrap = None exe_wrap = None
for compiler in compilers: for compiler in compilers:
try: try:
basename = os.path.basename(compiler).lower() basename = os.path.basename(compiler).lower()
if basename == 'cl' or basename == 'cl.exe': if basename == 'cl' or basename == 'cl.exe':
arg = '/?' arg = '/?'
else: else:
@ -1563,7 +1563,7 @@ class Environment():
is_cross = False is_cross = False
exe_wrap = None exe_wrap = None
for compiler in compilers: for compiler in compilers:
basename = os.path.basename(compiler).lower() basename = os.path.basename(compiler).lower()
if basename == 'cl' or basename == 'cl.exe': if basename == 'cl' or basename == 'cl.exe':
arg = '/?' arg = '/?'
else: else:

@ -48,13 +48,13 @@ class TryRunResultHolder(InterpreterObject):
'stdout' : self.stdout_method, 'stdout' : self.stdout_method,
'stderr' : self.stderr_method, 'stderr' : self.stderr_method,
}) })
def returncode_method(self, args, kwargs): def returncode_method(self, args, kwargs):
return self.res.returncode return self.res.returncode
def compiled_method(self, args, kwargs): def compiled_method(self, args, kwargs):
return self.res.compiled return self.res.compiled
def stdout_method(self, args, kwargs): def stdout_method(self, args, kwargs):
return self.res.stdout return self.res.stdout
@ -74,7 +74,7 @@ class RunProcess(InterpreterObject):
'stdout' : self.stdout_method, 'stdout' : self.stdout_method,
'stderr' : self.stderr_method, 'stderr' : self.stderr_method,
}) })
def run_command(self, command_array, source_dir, build_dir, subdir, in_builddir): def run_command(self, command_array, source_dir, build_dir, subdir, in_builddir):
cmd_name = command_array[0] cmd_name = command_array[0]
env = {'MESON_SOURCE_ROOT' : source_dir, env = {'MESON_SOURCE_ROOT' : source_dir,
@ -202,13 +202,13 @@ class ExternalLibraryHolder(InterpreterObject):
def get_name(self): def get_name(self):
return self.el.name return self.el.name
def get_compile_args(self): def get_compile_args(self):
return self.el.get_compile_args() return self.el.get_compile_args()
def get_link_args(self): def get_link_args(self):
return self.el.get_link_args() return self.el.get_link_args()
def get_exe_args(self): def get_exe_args(self):
return self.el.get_exe_args() return self.el.get_exe_args()
@ -264,7 +264,7 @@ class Host(InterpreterObject):
if self.environment.is_cross_build(): if self.environment.is_cross_build():
return self.environment.cross_info.get('name') return self.environment.cross_info.get('name')
return platform.system().lower() return platform.system().lower()
def is_big_endian_method(self, args, kwargs): def is_big_endian_method(self, args, kwargs):
return sys.byteorder != 'little' return sys.byteorder != 'little'
@ -289,7 +289,7 @@ class Headers(InterpreterObject):
def get_subdir(self): def get_subdir(self):
return self.subdir return self.subdir
def get_sources(self): def get_sources(self):
return self.sources return self.sources
@ -399,10 +399,10 @@ class Test(InterpreterObject):
self.is_parallel = is_parallel self.is_parallel = is_parallel
self.cmd_args = cmd_args self.cmd_args = cmd_args
self.env = env self.env = env
def get_exe(self): def get_exe(self):
return self.exe return self.exe
def get_name(self): def get_name(self):
return self.name return self.name
@ -492,7 +492,7 @@ class CompilerHolder(InterpreterObject):
hadtxt = mlog.green('YES') hadtxt = mlog.green('YES')
else: else:
hadtxt = mlog.red('NO') hadtxt = mlog.red('NO')
mlog.log('Checking whether type "', mlog.bold(typename), mlog.log('Checking whether type "', mlog.bold(typename),
'" has member "', mlog.bold(membername), '": ', hadtxt, sep='') '" has member "', mlog.bold(membername), '": ', hadtxt, sep='')
return had return had
@ -578,7 +578,7 @@ class MesonMain(InterpreterObject):
scriptbase = args[0] scriptbase = args[0]
if not isinstance(scriptbase, str): if not isinstance(scriptbase, str):
raise InterpreterException('Set_install_script argument is not a string.') raise InterpreterException('Set_install_script argument is not a string.')
scriptfile = os.path.join(self.interpreter.environment.source_dir, scriptfile = os.path.join(self.interpreter.environment.source_dir,
self.interpreter.subdir, scriptbase) self.interpreter.subdir, scriptbase)
if not os.path.isfile(scriptfile): if not os.path.isfile(scriptfile):
raise InterpreterException('Can not find install script %s.' % scriptbase) raise InterpreterException('Can not find install script %s.' % scriptbase)
@ -672,7 +672,7 @@ class Interpreter():
self.subproject_stack = [] self.subproject_stack = []
def build_func_dict(self): def build_func_dict(self):
self.funcs = {'project' : self.func_project, self.funcs = {'project' : self.func_project,
'message' : self.func_message, 'message' : self.func_message,
'error' : self.func_error, 'error' : self.func_error,
'executable': self.func_executable, 'executable': self.func_executable,
@ -796,7 +796,7 @@ class Interpreter():
if wanted != None: if wanted != None:
if not isinstance(actual, wanted): if not isinstance(actual, wanted):
raise InvalidArguments('Incorrect argument type.') raise InvalidArguments('Incorrect argument type.')
def func_run_command(self, node, args, kwargs): def func_run_command(self, node, args, kwargs):
if len(args) < 1: if len(args) < 1:
raise InterpreterException('Not enough arguments') raise InterpreterException('Not enough arguments')
@ -1142,7 +1142,7 @@ class Interpreter():
h = Headers(args, kwargs) h = Headers(args, kwargs)
self.build.headers.append(h) self.build.headers.append(h)
return h return h
def func_man(self, node, args, kwargs): def func_man(self, node, args, kwargs):
for a in args: for a in args:
if not isinstance(a, str): if not isinstance(a, str):
@ -1150,7 +1150,7 @@ class Interpreter():
m = Man(args, kwargs) m = Man(args, kwargs)
self.build.man.append(m) self.build.man.append(m)
return m return m
def func_subdir(self, node, args, kwargs): def func_subdir(self, node, args, kwargs):
if len(kwargs) > 0: if len(kwargs) > 0:
raise InvalidArguments('subdir command takes no keyword arguments.') raise InvalidArguments('subdir command takes no keyword arguments.')
@ -1194,7 +1194,7 @@ class Interpreter():
data = Data(args[0], args[1:], kwargs) data = Data(args[0], args[1:], kwargs)
self.build.data.append(data) self.build.data.append(data)
return data return data
def func_configure_file(self, node, args, kwargs): def func_configure_file(self, node, args, kwargs):
if len(args) > 0: if len(args) > 0:
raise InterpreterException("configure_file takes only keyword arguments.") raise InterpreterException("configure_file takes only keyword arguments.")
@ -1330,7 +1330,7 @@ class Interpreter():
isinstance(value, list): isinstance(value, list):
return True return True
return False return False
def assignment(self, node): def assignment(self, node):
assert(isinstance(node, mparser.AssignmentNode)) assert(isinstance(node, mparser.AssignmentNode))
var_name = node.var_name var_name = node.var_name
@ -1434,7 +1434,7 @@ class Interpreter():
raise InvalidArguments('Variable "%s" is not callable.' % object_name) raise InvalidArguments('Variable "%s" is not callable.' % object_name)
(args, kwargs) = self.reduce_arguments(args) (args, kwargs) = self.reduce_arguments(args)
return obj.method_call(method_name, args, kwargs) return obj.method_call(method_name, args, kwargs)
def evaluate_if(self, node): def evaluate_if(self, node):
assert(isinstance(node, mparser.IfClauseNode)) assert(isinstance(node, mparser.IfClauseNode))
for i in node.ifs: for i in node.ifs:
@ -1503,7 +1503,7 @@ class Interpreter():
if not isinstance(r, bool): if not isinstance(r, bool):
raise InterpreterException('Second argument to "or" is not a boolean.') raise InterpreterException('Second argument to "or" is not a boolean.')
return r return r
def evaluate_notstatement(self, cur): def evaluate_notstatement(self, cur):
v = self.evaluate_statement(cur.value) v = self.evaluate_statement(cur.value)
if isinstance(v, mparser.BooleanNode): if isinstance(v, mparser.BooleanNode):

@ -81,7 +81,7 @@ class MesonApp():
raise RuntimeError('--prefix must be an absolute path.') raise RuntimeError('--prefix must be an absolute path.')
self.meson_script_file = script_file self.meson_script_file = script_file
self.options = options self.options = options
def has_build_file(self, dirname): def has_build_file(self, dirname):
fname = os.path.join(dirname, environment.build_filename) fname = os.path.join(dirname, environment.build_filename)
return os.path.exists(fname) return os.path.exists(fname)

@ -57,7 +57,7 @@ def run_single_test(wrap, test):
else: else:
if test.is_cross: if test.is_cross:
if test.exe_runner is None: if test.exe_runner is None:
# Can not run test on cross compiled executable # Can not run test on cross compiled executable
# because there is no execute wrapper. # because there is no execute wrapper.
cmd = None cmd = None
else: else:

@ -18,7 +18,7 @@ import sys, os, pickle, time, shutil
import build, coredata, environment, optinterpreter import build, coredata, environment, optinterpreter
from PyQt5 import uic from PyQt5 import uic
from PyQt5.QtWidgets import QApplication, QMainWindow, QHeaderView from PyQt5.QtWidgets import QApplication, QMainWindow, QHeaderView
from PyQt5.QtWidgets import QComboBox, QCheckBox from PyQt5.QtWidgets import QComboBox, QCheckBox
from PyQt5.QtCore import QAbstractItemModel, QModelIndex, QVariant, QTimer from PyQt5.QtCore import QAbstractItemModel, QModelIndex, QVariant, QTimer
import PyQt5.QtCore import PyQt5.QtCore
import PyQt5.QtWidgets import PyQt5.QtWidgets
@ -45,7 +45,7 @@ class PathModel(QAbstractItemModel):
if index.isValid(): if index.isValid():
return 0 return 0
return len(self.names) return len(self.names)
def columnCount(self, index): def columnCount(self, index):
return 2 return 2
@ -111,7 +111,7 @@ class TargetModel(QAbstractItemModel):
if index.isValid(): if index.isValid():
return 0 return 0
return len(self.targets) return len(self.targets)
def columnCount(self, index): def columnCount(self, index):
return 4 return 4
@ -164,7 +164,7 @@ class DependencyModel(QAbstractItemModel):
if index.isValid(): if index.isValid():
return 0 return 0
return len(self.deps) return len(self.deps)
def columnCount(self, index): def columnCount(self, index):
return 4 return 4
@ -471,7 +471,7 @@ class MesonGui():
def clean(self, foo): def clean(self, foo):
self.run_process(['clean']) self.run_process(['clean'])
def save(self, foo): def save(self, foo):
pickle.dump(self.coredata, open(self.coredata_file, 'wb')) pickle.dump(self.coredata, open(self.coredata_file, 'wb'))

@ -29,11 +29,11 @@ def initialize(logdir):
class AnsiDecorator(): class AnsiDecorator():
plain_code = "\033[0m" plain_code = "\033[0m"
def __init__(self, text, code): def __init__(self, text, code):
self.text = text self.text = text
self.code = code self.code = code
def get_text(self, with_codes): def get_text(self, with_codes):
if with_codes: if with_codes:
return self.code + self.text + AnsiDecorator.plain_code return self.code + self.text + AnsiDecorator.plain_code

@ -30,7 +30,7 @@ class Token:
self.lineno = lineno self.lineno = lineno
self.colno = colno self.colno = colno
self.value = value self.value = value
def __eq__(self, other): def __eq__(self, other):
if isinstance(other, str): if isinstance(other, str):
return self.tid == other return self.tid == other
@ -273,7 +273,7 @@ class ArgumentNode():
# comparison, plus and multiplication would go here # comparison, plus and multiplication would go here
# 5 negation # 5 negation
# 6 funcall, method call # 6 funcall, method call
# 7 parentheses # 7 parentheses
# 8 plain token # 8 plain token
class Parser: class Parser:

@ -404,7 +404,7 @@ class NinjaBackend(backends.Backend):
def generate_custom_install_script(self, d): def generate_custom_install_script(self, d):
d.install_script = self.build.install_script d.install_script = self.build.install_script
def generate_header_install(self, d): def generate_header_install(self, d):
incroot = self.environment.get_includedir() incroot = self.environment.get_includedir()
@ -824,7 +824,7 @@ class NinjaBackend(backends.Backend):
invoc) invoc)
description = ' description = Compiling Rust source $in.\n' description = ' description = Compiling Rust source $in.\n'
depfile = ' depfile = $out.d\n' depfile = ' depfile = $out.d\n'
depstyle = ' deps = gcc\n' depstyle = ' deps = gcc\n'
outfile.write(rule) outfile.write(rule)
outfile.write(command) outfile.write(command)

Loading…
Cancel
Save