summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-09-27 09:30:47 -0700
committerJelmer Vernooij <jelmer@samba.org>2012-09-27 18:45:12 +0200
commit2a797f29aa12f6847844af504026be52db659fbb (patch)
tree8d3e4a6e2003239c5b69efd578c9452e0bc9b86d /buildtools
parent6986f7bdda56d693c642945485006f9660053758 (diff)
downloadsamba-2a797f29aa12f6847844af504026be52db659fbb.tar.gz
samba-2a797f29aa12f6847844af504026be52db659fbb.tar.bz2
samba-2a797f29aa12f6847844af504026be52db659fbb.zip
s4-python: Various formatting fixes.
* Trailing whitespace * use of "==" where "is" should be used * double spaces
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/nothreads.py6
-rw-r--r--buildtools/wafsamba/samba_abi.py2
-rw-r--r--buildtools/wafsamba/samba_autoconf.py10
-rw-r--r--buildtools/wafsamba/samba_bundled.py2
-rw-r--r--buildtools/wafsamba/samba_deps.py8
-rw-r--r--buildtools/wafsamba/samba_dist.py4
-rw-r--r--buildtools/wafsamba/samba_headers.py1
-rw-r--r--buildtools/wafsamba/samba_optimisation.py2
-rw-r--r--buildtools/wafsamba/samba_patterns.py2
-rw-r--r--buildtools/wafsamba/samba_utils.py10
-rw-r--r--buildtools/wafsamba/samba_version.py2
-rw-r--r--buildtools/wafsamba/stale_files.py2
-rw-r--r--buildtools/wafsamba/wafsamba.py4
13 files changed, 28 insertions, 27 deletions
diff --git a/buildtools/wafsamba/nothreads.py b/buildtools/wafsamba/nothreads.py
index 90babf4a28..075dcd326b 100644
--- a/buildtools/wafsamba/nothreads.py
+++ b/buildtools/wafsamba/nothreads.py
@@ -132,8 +132,10 @@ class Parallel(object):
self.frozen = []
elif not self.count:
(jobs, tmp) = self.manager.get_next_set()
- if jobs != None: self.maxjobs = jobs
- if tmp: self.outstanding += tmp
+ if jobs is not None:
+ self.maxjobs = jobs
+ if tmp:
+ self.outstanding += tmp
break
def get_out(self):
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index f5cac8a134..ed977ba4c2 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -154,7 +154,7 @@ def abi_process_file(fname, version, symmap):
def abi_write_vscript(vscript, libname, current_version, versions, symmap, abi_match):
'''write a vscript file for a library in --version-script format
-
+
:param vscript: Path to the vscript file
:param libname: Name of the library, uppercased
:param current_version: Current version
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 50039fccc3..5d3cc5a688 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -62,9 +62,9 @@ def COMPOUND_END(conf, result):
conf.check_message_1 = conf.saved_check_message_1
conf.check_message_2 = conf.saved_check_message_2
p = conf.check_message_2
- if result == True:
+ if result:
p('ok ')
- elif result == False:
+ elif not result:
p('not found', 'YELLOW')
else:
p(result)
@@ -241,7 +241,7 @@ def CHECK_FUNC(conf, f, link=True, lib=None, headers=None):
conf.COMPOUND_START('Checking for %s' % f)
- if link is None or link == True:
+ if link is None or link:
ret = CHECK_CODE(conf,
# this is based on the autoconf strategy
'''
@@ -284,7 +284,7 @@ def CHECK_FUNC(conf, f, link=True, lib=None, headers=None):
headers=headers,
msg='Checking for macro %s' % f)
- if not ret and (link is None or link == False):
+ if not ret and (link is None or not link):
ret = CHECK_VARIABLE(conf, f,
define=define,
headers=headers,
@@ -470,7 +470,7 @@ def CONFIG_SET(conf, option):
if option not in conf.env:
return False
v = conf.env[option]
- if v == None:
+ if v is None:
return False
if v == []:
return False
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 1a5d565b38..b8a4101dca 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -78,7 +78,7 @@ def LIB_MAY_BE_BUNDLED(conf, libname):
@conf
def LIB_MUST_BE_BUNDLED(conf, libname):
- return ('ALL' in conf.env.BUNDLED_LIBS or
+ return ('ALL' in conf.env.BUNDLED_LIBS or
libname in conf.env.BUNDLED_LIBS)
@conf
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index f073e41433..3220f3537d 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -136,7 +136,7 @@ def build_includes(self):
includes = []
# maybe add local includes
- if getattr(self, 'local_include', True) == True and getattr(self, 'local_include_first', True):
+ if getattr(self, 'local_include', True) and getattr(self, 'local_include_first', True):
includes.append('.')
includes.extend(self.samba_includes_extended)
@@ -153,7 +153,7 @@ def build_includes(self):
t = bld.name_to_obj(d, bld.env)
bld.ASSERT(t is not None, "Unable to find dependency %s for %s" % (d, self.sname))
inclist = getattr(t, 'samba_includes_extended', [])[:]
- if getattr(t, 'local_include', True) == True:
+ if getattr(t, 'local_include', True):
inclist.append('.')
if inclist == []:
continue
@@ -169,7 +169,7 @@ def build_includes(self):
relpath = os_path_relpath(inc, mypath)
includes.append(relpath)
- if getattr(self, 'local_include', True) == True and not getattr(self, 'local_include_first', True):
+ if getattr(self, 'local_include', True) and not getattr(self, 'local_include_first', True):
includes.append('.')
# now transform the includes list to be relative to the top directory
@@ -306,7 +306,7 @@ def check_orphaned_targets(bld, tgt_list):
debug('deps: checking for orphaned targets')
for t in tgt_list:
- if getattr(t, 'samba_used', False) == True:
+ if getattr(t, 'samba_used', False):
continue
type = target_dict[t.sname]
if not type in ['BINARY', 'LIBRARY', 'MODULE', 'ET', 'PYTHON']:
diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py
index 82492e135c..fae2759dac 100644
--- a/buildtools/wafsamba/samba_dist.py
+++ b/buildtools/wafsamba/samba_dist.py
@@ -98,10 +98,10 @@ def vcs_dir_contents(path):
return Utils.cmd_output(ls_files_cmd, cwd=cwd, env=env).split()
-def dist(appname='',version=''):
+def dist(appname='', version=''):
def add_files_to_tarball(tar, srcdir, srcsubdir, dstdir, dstsubdir, blacklist, files):
- if blacklist == None:
+ if blacklist is None:
blacklist = []
for f in files:
abspath = os.path.join(srcdir, f)
diff --git a/buildtools/wafsamba/samba_headers.py b/buildtools/wafsamba/samba_headers.py
index cca6420b6c..50ccad743d 100644
--- a/buildtools/wafsamba/samba_headers.py
+++ b/buildtools/wafsamba/samba_headers.py
@@ -119,7 +119,6 @@ def public_headers_simple(bld, public_headers, header_path=None, public_headers_
h_name = h
inst_name = os.path.basename(h)
bld.INSTALL_FILES('${INCLUDEDIR}', h_name, destname=inst_name)
-
def PUBLIC_HEADERS(bld, public_headers, header_path=None, public_headers_install=True):
diff --git a/buildtools/wafsamba/samba_optimisation.py b/buildtools/wafsamba/samba_optimisation.py
index 2436e9b769..f0f430d2bf 100644
--- a/buildtools/wafsamba/samba_optimisation.py
+++ b/buildtools/wafsamba/samba_optimisation.py
@@ -31,7 +31,7 @@ def apply_incpaths(self):
for path in self.to_list(self.includes):
if not path in lst:
- if preproc.go_absolute or path[0] != '/': #os.path.isabs(path):
+ if preproc.go_absolute or path[0] != '/': # os.path.isabs(path):
lst.append(path)
else:
self.env.prepend_value('CPPPATH', path)
diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index dc988c597e..615d918ba6 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -21,7 +21,7 @@ def write_version_header(task):
def SAMBA_MKVERSION(bld, target):
'''generate the version.h header for Samba'''
- t = bld.SAMBA_GENERATOR('VERSION',
+ t = bld.SAMBA_GENERATOR('VERSION',
rule=write_version_header,
source= 'VERSION',
target=target,
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index c252663b93..c1869df1c2 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -256,7 +256,7 @@ def ENFORCE_GROUP_ORDERING(bld):
@feature('*')
@before('exec_rule', 'apply_core', 'collect')
def force_previous_groups(self):
- if getattr(self.bld, 'enforced_group_ordering', False) == True:
+ if getattr(self.bld, 'enforced_group_ordering', False):
return
self.bld.enforced_group_ordering = True
@@ -274,7 +274,7 @@ def ENFORCE_GROUP_ORDERING(bld):
debug('group: Forcing up to group %s for target %s',
group_name(g), self.name or self.target)
break
- if stop != None:
+ if stop is not None:
break
if stop is None:
return
@@ -502,15 +502,15 @@ def CHECK_MAKEFLAGS(bld):
if v == 'j':
jobs_set = True
elif v == 'k':
- Options.options.keep = True
+ Options.options.keep = True
elif opt == '-j':
jobs_set = True
elif opt == '-k':
- Options.options.keep = True
+ Options.options.keep = True
if not jobs_set:
# default to one job
Options.options.jobs = 1
-
+
Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS
option_groups = {}
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index e82fd4723e..67ff232404 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -132,7 +132,7 @@ class SambaVersion(object):
def __init__(self, version_dict, path, env=None, is_install=True):
'''Determine the version number of samba
-See VERSION for the format. Entries on that file are
+See VERSION for the format. Entries on that file are
also accepted as dictionary entries here
'''
diff --git a/buildtools/wafsamba/stale_files.py b/buildtools/wafsamba/stale_files.py
index 5a913677d1..2dd08e1497 100644
--- a/buildtools/wafsamba/stale_files.py
+++ b/buildtools/wafsamba/stale_files.py
@@ -47,7 +47,7 @@ def replace_refill_task_list(self):
# paranoia
if bin_base[-4:] != '/bin':
raise Utils.WafError("Invalid bin base: %s" % bin_base)
-
+
# obtain the expected list of files
expected = []
for i in range(len(bld.task_manager.groups)):
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 50bd4fa6e2..59d3a2c02f 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -285,7 +285,7 @@ def SAMBA_LIBRARY(bld, libname, source,
if pc_files is not None and not private_library:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
- if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and
+ if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and
bld.env['XSLTPROC_MANPAGES']):
bld.MANPAGES(manpages)
@@ -670,7 +670,7 @@ def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None):
bld.SET_BUILD_GROUP('build_source')
for s in TO_LIST(source):
iname = s
- if installname != None:
+ if installname is not None:
iname = installname
target = os.path.join(installdir, iname)
tgtdir = os.path.dirname(os.path.join(bld.srcnode.abspath(bld.env), '..', target))