fix PEP8 "E231 missing whitespace after ','"

This commit is contained in:
Hans-Christoph Steiner 2014-05-01 22:16:32 -04:00
parent f1812d5935
commit 998011d535
7 changed files with 25 additions and 25 deletions

2
fdroid
View File

@ -42,7 +42,7 @@ def print_help():
print "usage: fdroid [-h|--help] <command> [<args>]"
print
print "Valid commands are:"
for cmd,summary in commands.items():
for cmd, summary in commands.items():
print " " + cmd + ' '*(15-len(cmd)) + summary
print

View File

@ -212,9 +212,9 @@ def check_repomanifest(app, branch=None):
if package != appid:
return (None, "Package ID mismatch")
if not version:
return (None,"Couldn't find latest version name")
return (None, "Couldn't find latest version name")
if not vercode:
return (None,"Couldn't find latest version code")
return (None, "Couldn't find latest version code")
vercode = str(int(vercode))

View File

@ -686,9 +686,9 @@ def retrieve_string(app_dir, string, xmlfiles=None):
if xmlfiles is None:
xmlfiles = []
for res_dir in res_dirs:
for r,d,f in os.walk(res_dir):
for r, d, f in os.walk(res_dir):
if r.endswith('/values'):
xmlfiles += [os.path.join(r,x) for x in f if x.endswith('.xml')]
xmlfiles += [os.path.join(r, x) for x in f if x.endswith('.xml')]
string_search = None
if string.startswith('@string/'):
@ -704,7 +704,7 @@ def retrieve_string(app_dir, string, xmlfiles=None):
return retrieve_string(app_dir, matches.group(1), xmlfiles)
return None
return string.replace("\\'","'")
return string.replace("\\'", "'")
# Return list of existing files that will be used to find the highest vercode
def manifest_paths(app_dir, flavour):
@ -776,7 +776,7 @@ def ant_subprojects(root_dir):
for subpath in subprojects:
subrelpath = os.path.join(root_dir, subpath)
for p in get_library_references(subrelpath):
relp = os.path.normpath(os.path.join(subpath,p))
relp = os.path.normpath(os.path.join(subpath, p))
if relp not in subprojects:
subprojects.insert(0, relp)
return subprojects
@ -787,7 +787,7 @@ def remove_debuggable_flags(root_dir):
for root, dirs, files in os.walk(root_dir):
if 'AndroidManifest.xml' in files:
path = os.path.join(root, 'AndroidManifest.xml')
p = FDroidPopen(['sed','-i', 's/android:debuggable="[^"]*"//g', path])
p = FDroidPopen(['sed', '-i', 's/android:debuggable="[^"]*"//g', path])
if p.returncode != 0:
raise BuildException("Failed to remove debuggable flags of %s" % path)
@ -901,7 +901,7 @@ def getsrclib(spec, srclib_dir, srclibpaths=[], subdir=None,
if ':' in name:
number, name = name.split(':', 1)
if '/' in name:
name, subdir = name.split('/',1)
name, subdir = name.split('/', 1)
srclib_path = os.path.join('srclibs', name + ".txt")
@ -936,7 +936,7 @@ def getsrclib(spec, srclib_dir, srclibpaths=[], subdir=None,
if srclib["Srclibs"]:
n = 1
for lib in srclib["Srclibs"].replace(';',',').split(','):
for lib in srclib["Srclibs"].replace(';', ',').split(','):
s_tuple = None
for t in srclibpaths:
if t[0] == lib:
@ -1083,7 +1083,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
's@compileSdkVersion *[0-9]*@compileSdkVersion '+n+'@g',
'build.gradle'], cwd=root_dir)
if '@' in build['gradle']:
gradle_dir = os.path.join(root_dir, build['gradle'].split('@',1)[1])
gradle_dir = os.path.join(root_dir, build['gradle'].split('@', 1)[1])
gradle_dir = os.path.normpath(gradle_dir)
FDroidPopen(['sed', '-i',
's@compileSdkVersion *[0-9]*@compileSdkVersion '+n+'@g',
@ -1286,7 +1286,7 @@ def scan_source(build_dir, root_dir, thisbuild):
return path.endswith('/%s' % dirname) or '/%s/' % dirname in path
# Iterate through all files in the source code
for r,d,f in os.walk(build_dir):
for r, d, f in os.walk(build_dir):
if any(insidedir(r, d) for d in ('.hg', '.git', '.svn', '.bzr')):
continue
@ -1417,7 +1417,7 @@ class KnownApks:
else:
apps[appid] = added
sortedapps = sorted(apps.iteritems(), key=operator.itemgetter(1))[-num:]
lst = [app for app,_ in sortedapps]
lst = [app for app, _ in sortedapps]
lst.reverse()
return lst
@ -1566,7 +1566,7 @@ def remove_signing_keys(build_dir):
continue
o.write(line)
logging.info("Cleaned %s of keysigning configs at %s" % (propfile,path))
logging.info("Cleaned %s of keysigning configs at %s" % (propfile, path))
def replace_config_vars(cmd):
cmd = cmd.replace('$$SDK$$', config['sdk_path'])
@ -1589,10 +1589,10 @@ def place_srclib(root_dir, number, libpath):
placed = False
for line in lines:
if line.startswith('android.library.reference.%d=' % number):
o.write('android.library.reference.%d=%s\n' % (number,relpath))
o.write('android.library.reference.%d=%s\n' % (number, relpath))
placed = True
else:
o.write(line)
if not placed:
o.write('android.library.reference.%d=%s\n' % (number,relpath))
o.write('android.library.reference.%d=%s\n' % (number, relpath))

View File

@ -171,7 +171,7 @@ def main():
lastcommit, app['Update Check Mode']))
# No proper license
if app['License'] in ('Unknown','None',''):
if app['License'] in ('Unknown', 'None', ''):
warn("License was not set")
# Summary size limit

View File

@ -363,7 +363,7 @@ def description_wiki(lines):
# Parse multiple lines of description as written in a metadata file, returning
# a single string in HTML format.
def description_html(lines,linkres):
def description_html(lines, linkres):
ps = DescriptionFormatter(linkres)
for line in lines:
ps.parseline(line)
@ -394,7 +394,7 @@ def parse_srclib(metafile, **kw):
continue
try:
field, value = line.split(':',1)
field, value = line.split(':', 1)
except ValueError:
raise MetaDataException("Invalid metadata in %s:%d" % (line, n))
@ -507,7 +507,7 @@ def parse_metadata(metafile):
t = flagtype(pk)
if t == 'list':
# Port legacy ';' separators
thisbuild[pk] = [v.strip() for v in pv.replace(';',',').split(',')]
thisbuild[pk] = [v.strip() for v in pv.replace(';', ',').split(',')]
elif t == 'string':
thisbuild[pk] = pv
elif t == 'script':
@ -610,7 +610,7 @@ def parse_metadata(metafile):
curcomments.append(line)
continue
try:
field, value = line.split(':',1)
field, value = line.split(':', 1)
except ValueError:
raise MetaDataException("Invalid metadata in "+linedesc)
if field != field.strip() or value != value.strip():
@ -633,7 +633,7 @@ def parse_metadata(metafile):
elif fieldtype == 'string':
thisinfo[field] = value
elif fieldtype == 'list':
thisinfo[field] = [v.strip() for v in value.replace(';',',').split(',')]
thisinfo[field] = [v.strip() for v in value.replace(';', ',').split(',')]
elif fieldtype == 'build':
if value.endswith("\\"):
mode = 2

View File

@ -152,7 +152,7 @@ def main():
raise BuildException("Failed to sign application")
# Zipalign it...
p = FDroidPopen([os.path.join(config['sdk_path'],'tools','zipalign'),
p = FDroidPopen([os.path.join(config['sdk_path'], 'tools', 'zipalign'),
'-v', '4', apkfile,
os.path.join(output_dir, apkfilename)])
if p.returncode != 0:

View File

@ -296,7 +296,7 @@ def resize_icon(iconpath, density):
else:
logging.info("%s is small enough: %s" % im.size)
except Exception,e:
except Exception, e:
logging.error("Failed resizing {0} - {1}".format(iconpath, e))
def resize_all_icons(repodirs):
@ -503,7 +503,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
os.path.join(get_icon_dir(repodir, density), iconfilename))
empty_densities.remove(density)
break
except Exception,e:
except Exception, e:
logging.warn("Failed reading {0} - {1}".format(iconpath, e))
if thisinfo['icons']: