* [gentoo-commits] proj/catalyst:master commit in: /, doc/, catalyst/
@ 2015-10-06 15:31 Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2015-10-06 15:31 UTC (permalink / raw
To: gentoo-commits
commit: b48733ee81b9d68ef1629f772071924142979e31
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 6 15:02:47 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct 6 15:02:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b48733ee
lint: clean up superfluous parens
These don't need the parens, so omit them.
In the case of setup.py, we were expecting a print function, not a
keyword, so make sure to import that module.
catalyst/lock.py | 6 +++---
doc/make_subarch_table_guidexml.py | 6 +++---
setup.py | 1 +
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/catalyst/lock.py b/catalyst/lock.py
index d079b2d..3d50c06 100644
--- a/catalyst/lock.py
+++ b/catalyst/lock.py
@@ -179,7 +179,7 @@ class LockDir(object):
if not os.path.exists(self.lockfile):
print "lockfile does not exist '%s'" % self.lockfile
#print "fcntl_unlock() , self.myfd:", self.myfd, type(self.myfd)
- if (self.myfd != None):
+ if self.myfd != None:
#print "fcntl_unlock() trying to close it "
try:
os.close(self.myfd)
@@ -236,7 +236,7 @@ class LockDir(object):
#if type(lockfilename) == types.StringType:
# os.close(myfd)
#print "fcntl_unlock() trying a last ditch close", self.myfd
- if (self.myfd != None):
+ if self.myfd != None:
os.close(self.myfd)
self.myfd=None
self.locked=False
@@ -256,7 +256,7 @@ class LockDir(object):
start_time = time.time()
reported_waiting = False
- while(time.time() < (start_time + max_wait)):
+ while time.time() < (start_time + max_wait):
# We only need it to exist.
self.myfd = os.open(self.myhardlock, os.O_CREAT|os.O_RDWR,0660)
os.close(self.myfd)
diff --git a/doc/make_subarch_table_guidexml.py b/doc/make_subarch_table_guidexml.py
index 54e0a4a..a6a9022 100755
--- a/doc/make_subarch_table_guidexml.py
+++ b/doc/make_subarch_table_guidexml.py
@@ -30,7 +30,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
# Apply alias grouping
arch = _pattern_arch_genericliases.get(arch, arch)
- assert(subarch not in subarch_id_to_pattern_arch_genericrch_id)
+ assert subarch not in subarch_id_to_pattern_arch_genericrch_id
subarch_id_to_pattern_arch_genericrch_id[subarch] = arch
return
@@ -40,7 +40,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
child_subarch = x.group(1)
parent_subarch = x.group(2)
- assert(child_subarch not in subarch_id_to_pattern_arch_genericrch_id)
+ assert child_subarch not in subarch_id_to_pattern_arch_genericrch_id
subarch_id_to_pattern_arch_genericrch_id[child_subarch] = subarch_id_to_pattern_arch_genericrch_id[parent_subarch]
return
@@ -49,7 +49,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
subarch_title = x.group(1)
subarch_id = x.group(2)
- assert(subarch_title not in subarch_title_to_subarch_id)
+ assert subarch_title not in subarch_title_to_subarch_id
subarch_title_to_subarch_id[subarch_title] = subarch_id
diff --git a/setup.py b/setup.py
index e4569ee..a875db1 100755
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,6 @@
"""Catalyst is a release building tool used by Gentoo Linux"""
+from __future__ import print_function
import codecs as _codecs
from distutils.core import setup as _setup, Command as _Command
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/catalyst:master commit in: /, doc/, catalyst/
@ 2015-10-28 16:50 Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2015-10-28 16:50 UTC (permalink / raw
To: gentoo-commits
commit: b3cfe6e0c7754a9e17b681581b2a317b7861b486
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 12 03:59:28 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Oct 28 16:49:56 2015 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b3cfe6e0
lint: fix redefined-outer-name warnings
The doc module just needs a main func to hold all the variables
instead of coding it all in global scope.
.pylintrc | 3 +--
catalyst/log.py | 4 ++++
doc/make_subarch_table_guidexml.py | 9 +++++++--
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/.pylintrc b/.pylintrc
index 2a03f23..e657daf 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -32,10 +32,9 @@ load-plugins=
# bad-continuation -- might be hard with tab indentation policy
# invalid-name -- need to manage constants better
# line-too-long -- figure out a length and stick to it
-# redefined-outer-name -- clean up code to not do this
# super-init-not-called -- fix the classes __init__ structure
# no-init -- update classes w/missing __init__ functions
-disable=missing-docstring, too-many-lines, too-many-branches, too-many-statements, too-few-public-methods, too-many-instance-attributes, too-many-public-methods, too-many-locals, too-many-arguments, locally-enabled, locally-disabled, fixme, broad-except, bad-whitespace, bad-continuation, invalid-name, line-too-long, redefined-outer-name, super-init-not-called, no-init
+disable=missing-docstring, too-many-lines, too-many-branches, too-many-statements, too-few-public-methods, too-many-instance-attributes, too-many-public-methods, too-many-locals, too-many-arguments, locally-enabled, locally-disabled, fixme, broad-except, bad-whitespace, bad-continuation, invalid-name, line-too-long, super-init-not-called, no-init
[REPORTS]
diff --git a/catalyst/log.py b/catalyst/log.py
index 5938199..d640dec 100644
--- a/catalyst/log.py
+++ b/catalyst/log.py
@@ -98,6 +98,10 @@ class CatalystFormatter(logging.Formatter):
return msg
+# We define |debug| in global scope so people can call log.debug(), but it
+# makes the linter complain when we have a |debug| keyword. Since we don't
+# use that func in here, it's not a problem, so silence the warning.
+# pylint: disable=redefined-outer-name
def setup_logging(level, output=None, debug=False, color=None):
"""Initialize the logging module using the |level| level"""
# The incoming level will be things like "info", but setLevel wants
diff --git a/doc/make_subarch_table_guidexml.py b/doc/make_subarch_table_guidexml.py
index a6a9022..0699d2a 100755
--- a/doc/make_subarch_table_guidexml.py
+++ b/doc/make_subarch_table_guidexml.py
@@ -6,6 +6,7 @@
import os
import re
+import sys
import textwrap
@@ -99,11 +100,11 @@ def dump(subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id):
f.close()
-if __name__ == '__main__':
+def main(_argv):
subarch_title_to_subarch_id = dict()
subarch_id_to_pattern_arch_genericrch_id = dict()
- for (dirpath, dirnames, filenames) in os.walk('catalyst/arch'):
+ for dirpath, _dirnames, filenames in os.walk('catalyst/arch'):
for _fn in filenames:
if not _fn.endswith('.py'):
continue
@@ -114,3 +115,7 @@ if __name__ == '__main__':
handle_file(fn, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id)
dump(subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id)
+
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-28 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-28 16:50 [gentoo-commits] proj/catalyst:master commit in: /, doc/, catalyst/ Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2015-10-06 15:31 Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox