提交 903e5be1 编写于 作者: B Bastian Blank 提交者: Joerg Jaspert

Fix E225: Missing whitespace around operator

上级 e7e0e754
......@@ -100,7 +100,7 @@ def main():
name = n.group(1)
# Look for all email addresses on the key.
emails=[]
emails = []
for line in output.split('\n'):
e = re_user_mails.search(line)
if not e:
......@@ -134,7 +134,7 @@ def main():
# Should we send mail to the newly added user?
if Cnf.find_b("Add-User::SendEmail"):
mail = name + "<" + emails[0] +">"
mail = name + "<" + emails[0] + ">"
Subst = {}
Subst["__NEW_MAINTAINER__"] = mail
Subst["__UID__"] = uid
......
......@@ -100,7 +100,7 @@ class BugClassifier(object):
tagged_bugs_ftp += tagged_bugs[tags]
return [bug for bug in bts.get_status(bts.get_bugs("package", "ftp.debian.org")) \
if bug.pending=='pending' and bug.bug_num not in tagged_bugs_ftp]
if bug.pending == 'pending' and bug.bug_num not in tagged_bugs_ftp]
def classify_bug(self, bug):
"""
......@@ -173,13 +173,13 @@ def main():
sys.exit(0)
if Options["Quiet"]:
level=logging.ERROR
level = logging.ERROR
elif Options["Verbose"]:
level=logging.DEBUG
level = logging.DEBUG
else:
level=logging.INFO
level = logging.INFO
logging.basicConfig(level=level,
format='%(asctime)s %(levelname)s %(message)s',
......
......@@ -186,7 +186,7 @@ class Updates:
x = read_hashs(2,2,f,self)
continue
if l[0] == "Canonical-Name:" or l[0]=="Canonical-Path:":
if l[0] == "Canonical-Name:" or l[0] == "Canonical-Path:":
self.can_path = l[1]
if l[0] == "SHA1-Current:" and len(l) == 3:
......@@ -318,7 +318,7 @@ def genchanges(Options, outdir, oldfile, origfile, maxdiffs=56):
# print "info: old file " + oldfile + " changed! %s %s => %s %s" % (upd.filesizesha1 + oldsizesha1)
if "CanonicalPath" in Options:
upd.can_path=Options["CanonicalPath"]
upd.can_path = Options["CanonicalPath"]
if os.path.exists(newfile):
os.unlink(newfile)
......@@ -427,7 +427,7 @@ def main():
cwd = os.getcwd()
for component in components:
#print "DEBUG: Working on %s" % (component)
workpath=os.path.join(tree, component, "i18n")
workpath = os.path.join(tree, component, "i18n")
if os.path.isdir(workpath):
os.chdir(workpath)
for dirpath, dirnames, filenames in os.walk(".", followlinks=True, topdown=True):
......@@ -436,9 +436,9 @@ def main():
#print "EXCLUDING %s" % (entry)
continue
(fname, fext) = os.path.splitext(entry)
processfile=os.path.join(workpath, fname)
processfile = os.path.join(workpath, fname)
#print "Working: %s" % (processfile)
storename="%s/%s_%s_%s" % (Options["TempDir"], suite, component, fname)
storename = "%s/%s_%s_%s" % (Options["TempDir"], suite, component, fname)
#print "Storefile: %s" % (storename)
genchanges(Options, processfile + ".diff", storename, processfile, maxdiffs)
os.chdir(cwd)
......
......@@ -322,7 +322,7 @@ class ReleaseWriter(object):
out.write("Date: %s\n" % (time.strftime("%a, %d %b %Y %H:%M:%S UTC", time.gmtime(time.time()))))
if suite.validtime:
validtime=float(suite.validtime)
validtime = float(suite.validtime)
out.write("Valid-Until: %s\n" % (time.strftime("%a, %d %b %Y %H:%M:%S UTC", time.gmtime(time.time()+validtime))))
for key, dbfield in boolattrs:
......@@ -493,7 +493,7 @@ def main():
query = query.join(Suite.archive).filter(Archive.archive_name.in_(archive_names))
suites = query.all()
broken=[]
broken = []
for s in suites:
# Setup a multiprocessing Pool. As many workers as we have CPU cores.
......
......@@ -145,11 +145,11 @@ def main():
if Options['Help']:
usage()
changesfiles={}
changesfiles = {}
for a in changes_files:
if not a.endswith(".changes"):
utils.fubar("not a .changes file: %s" % (a))
changesfiles[a]=1
changesfiles[a] = 1
changes = changesfiles.keys()
username = utils.getusername()
......@@ -176,16 +176,16 @@ def main():
# Yes, we could do this inside do_Approve too. But this way we see who exactly
# called it (ownership of the file)
acceptfiles={}
acceptfiles = {}
for change in changes:
dbchange=get_dbchange(os.path.basename(change), session)
dbchange = get_dbchange(os.path.basename(change), session)
# strip epoch from version
version=dbchange.version
version=version[(version.find(':')+1):]
version = dbchange.version
version = version[(version.find(':')+1):]
# strip possible version from source (binNMUs)
source = dbchange.source.split(None, 1)[0]
acceptfilename="%s/COMMENTS/ACCEPT.%s_%s" % (os.path.dirname(os.path.abspath(changes[0])), source, version)
acceptfiles[acceptfilename]=1
acceptfilename = "%s/COMMENTS/ACCEPT.%s_%s" % (os.path.dirname(os.path.abspath(changes[0])), source, version)
acceptfiles[acceptfilename] = 1
print "Would create %s now and then go on to accept this package, if you allow me to." % (acceptfiles.keys())
if Options["No-Action"]:
......
......@@ -342,7 +342,7 @@ def table_row(source, version, arch, last_mod, maint, distribution, closes, fing
for close in closes:
print "<a href=\"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s\">#%s</a><br/>" % (utils.html_escape(close), utils.html_escape(close))
print "</td></tr>"
row_number+=1
row_number += 1
############################################################
......@@ -447,7 +447,7 @@ def process_queue(queue, log, rrd_dir):
fingerprint = ""
changeby = {}
changedby = ""
sponsor= ""
sponsor = ""
filename = i[1]["list"][0].changes.changesname
last_modified = time.time()-i[1]["oldest"]
source = i[1]["list"][0].changes.source
......
......@@ -114,7 +114,7 @@ def table_row(changesname, delay, changed_by, closes, fingerprint):
res += ('<td valign="top">%s</td>' %
''.join(map(lambda close: '<a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s">#%s</a><br>' % (close, close),closes)))
res += '</tr>\n'
row_number+=1
row_number += 1
return res
......@@ -179,8 +179,8 @@ def get_upload_data(changesfn):
m = re.match(r'([0-9]+)-day', delay)
if m:
delaydays = int(m.group(1))
remainingtime = (delaydays>0)*max(0,24*60*60+os.stat(changesfn).st_mtime-time.time())
delay = "%d days %02d:%02d" %(max(delaydays-1,0), int(remainingtime/3600),int(remainingtime/60)%60)
remainingtime = (delaydays > 0)*max(0,24*60*60+os.stat(changesfn).st_mtime-time.time())
delay = "%d days %02d:%02d" % (max(delaydays-1,0), int(remainingtime/3600),int(remainingtime/60)%60)
else:
delaydays = 0
remainingtime = 0
......@@ -297,7 +297,7 @@ def init():
def main():
args = init()
if len(args)!=0:
if len(args) != 0:
usage(1)
if "Show-Deferred::Options::Rrd" in Cnf:
......
......@@ -138,7 +138,7 @@ def html_header(name, missing):
def html_footer():
result = """ <p class="validate">Timestamp: %s (UTC)</p>
"""% (time.strftime("%d.%m.%Y / %H:%M:%S", time.gmtime()))
""" % (time.strftime("%d.%m.%Y / %H:%M:%S", time.gmtime()))
result += "</body></html>"
return result
......
......@@ -451,9 +451,9 @@ def check_transitions(transitions):
answer = ""
if Options["no-action"]:
answer="n"
answer = "n"
elif Options["automatic"]:
answer="y"
answer = "y"
else:
answer = utils.our_raw_input(prompt).lower()
......
......@@ -130,7 +130,7 @@ Updates dak's database schema to the lastest version. You should disable crontab
if "DB::Service" in cnf:
connect_str = "service=%s" % cnf["DB::Service"]
else:
connect_str = "dbname=%s"% (cnf["DB::Name"])
connect_str = "dbname=%s" % (cnf["DB::Name"])
if "DB::Host" in cnf and cnf["DB::Host"] != '':
connect_str += " host=%s" % (cnf["DB::Host"])
if "DB::Port" in cnf and cnf["DB::Port"] != '-1':
......
......@@ -181,7 +181,7 @@ class Changes(object):
"""add "missing" in fields which we will require for the known_changes table"""
for key in ['urgency', 'maintainer', 'fingerprint', 'changed-by']:
if (key not in self.changes) or (not self.changes[key]):
self.changes[key]='missing'
self.changes[key] = 'missing'
def __get_file_from_pool(self, filename, entry, session, logger):
cnf = Config()
......
......@@ -328,7 +328,7 @@ class Architecture(ORMObject):
def __eq__(self, val):
if isinstance(val, str):
return (self.arch_string== val)
return (self.arch_string == val)
# This signals to use the normal comparison operator
return NotImplemented
......@@ -2349,7 +2349,7 @@ class DBConn(object):
mapper(BuildQueue, self.tbl_build_queue,
properties=dict(queue_id=self.tbl_build_queue.c.id,
suite=relation(Suite, primaryjoin=(self.tbl_build_queue.c.suite_id==self.tbl_suite.c.id))))
suite=relation(Suite, primaryjoin=(self.tbl_build_queue.c.suite_id == self.tbl_suite.c.id))))
mapper(DBBinary, self.tbl_binaries,
properties=dict(binary_id=self.tbl_binaries.c.id,
......@@ -2432,9 +2432,9 @@ class DBConn(object):
mapper(Maintainer, self.tbl_maintainer,
properties=dict(maintainer_id=self.tbl_maintainer.c.id,
maintains_sources=relation(DBSource, backref='maintainer',
primaryjoin=(self.tbl_maintainer.c.id==self.tbl_source.c.maintainer)),
primaryjoin=(self.tbl_maintainer.c.id == self.tbl_source.c.maintainer)),
changed_sources=relation(DBSource, backref='changedby',
primaryjoin=(self.tbl_maintainer.c.id==self.tbl_source.c.changedby))),
primaryjoin=(self.tbl_maintainer.c.id == self.tbl_source.c.changedby))),
)
mapper(NewComment, self.tbl_new_comments,
......@@ -2501,7 +2501,7 @@ class DBConn(object):
fingerprint=relation(Fingerprint),
changedby_id=self.tbl_source.c.changedby,
srcfiles=relation(DSCFile,
primaryjoin=(self.tbl_source.c.id==self.tbl_dsc_files.c.source)),
primaryjoin=(self.tbl_source.c.id == self.tbl_dsc_files.c.source)),
suites=relation(Suite, secondary=self.tbl_src_associations,
backref=backref('sources', lazy='dynamic')),
uploaders=relation(Maintainer,
......@@ -2571,9 +2571,9 @@ class DBConn(object):
mapper(VersionCheck, self.tbl_version_check,
properties=dict(
suite_id=self.tbl_version_check.c.suite,
suite=relation(Suite, primaryjoin=self.tbl_version_check.c.suite==self.tbl_suite.c.id),
suite =relation(Suite, primaryjoin=self.tbl_version_check.c.suite == self.tbl_suite.c.id),
reference_id=self.tbl_version_check.c.reference,
reference=relation(Suite, primaryjoin=self.tbl_version_check.c.reference==self.tbl_suite.c.id, lazy='joined')))
reference=relation(Suite, primaryjoin=self.tbl_version_check.c.reference == self.tbl_suite.c.id, lazy='joined')))
## Connection functions
def __createconn(self):
......
......@@ -98,7 +98,7 @@ def list_packages(packages, suites=None, components=None, architectures=None, bi
val = lambda: defaultdict(val)
ret = val()
for row in result:
ret[row[t.c.package]][row[t.c.display_suite]][row[t.c.version]]={'component': row[t.c.component],
ret[row[t.c.package]][row[t.c.display_suite]][row[t.c.version]] = {'component': row[t.c.component],
'architectures': row[c_architectures].split(','),
'source': row[t.c.source],
'source_version': row[t.c.source_version]
......
......@@ -273,7 +273,7 @@ def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None):
must_keywords = ('Format', 'Date', 'Source', 'Binary', 'Architecture', 'Version',
'Distribution', 'Maintainer', 'Description', 'Changes', 'Files')
missingfields=[]
missingfields = []
for keyword in must_keywords:
if keyword.lower() not in changes:
missingfields.append(keyword)
......
......@@ -50,7 +50,7 @@ projectB = None
projectBdb = None
DBNAME = "uploads-queue.db"
sqliteConn = None
maintainer_id_cache={}
maintainer_id_cache = {}
###############################################################################
......@@ -109,7 +109,7 @@ def insert():
res = __get_changedby__(row[1], row[2])
except:
print 'FAILED SQLITE'
res=None
res = None
sqliteConn.text_factory = unicode
if res:
changedby_id = get_or_set_maintainer_id(res[0])
......
......@@ -14,7 +14,6 @@ ignore =
E127,
E128,
E129,
E225,
E226,
E227,
E228,
......
......@@ -26,10 +26,10 @@ from daklib.filewriter import (BinaryContentsFileWriter,
PackagesFileWriter,
TranslationFileWriter)
SUITE='unstable'
COMPONENT='main'
ARCH='amd64'
LANG='en'
SUITE = 'unstable'
COMPONENT = 'main'
ARCH = 'amd64'
LANG = 'en'
class FileWriterTest(DakTestCase):
......
......@@ -13,7 +13,7 @@ ITEMS_TO_KEEP = 20
CACHE_FILE = '/srv/ftp-master.debian.org/misc/dinstall_time_cache'
GRAPH_DIR = '/srv/ftp.debian.org/web/stat'
LINE = re.compile(r'(?:|.*/)dinstall_(\d{4})\.(\d{2})\.(\d{2})-(\d{2}):(\d{2}):(\d{2})\.log(?:\.bz2)?:'+
LINE = re.compile(r'(?:|.*/)dinstall_(\d{4})\.(\d{2})\.(\d{2})-(\d{2}):(\d{2}):(\d{2})\.log(?:\.bz2)?:' +
r'Archive maintenance timestamp \(([^\)]*)\): (\d{2}):(\d{2}):(\d{2})$')
UNSAFE = re.compile(r'[^a-zA-Z/\._:0-9\- ]')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册