fix PEP8 "E231 missing whitespace after ','"
This commit is contained in:
parent
f1812d5935
commit
998011d535
2
fdroid
2
fdroid
@ -42,7 +42,7 @@ def print_help():
|
|||||||
print "usage: fdroid [-h|--help] <command> [<args>]"
|
print "usage: fdroid [-h|--help] <command> [<args>]"
|
||||||
print
|
print
|
||||||
print "Valid commands are:"
|
print "Valid commands are:"
|
||||||
for cmd,summary in commands.items():
|
for cmd, summary in commands.items():
|
||||||
print " " + cmd + ' '*(15-len(cmd)) + summary
|
print " " + cmd + ' '*(15-len(cmd)) + summary
|
||||||
print
|
print
|
||||||
|
|
||||||
|
@ -212,9 +212,9 @@ def check_repomanifest(app, branch=None):
|
|||||||
if package != appid:
|
if package != appid:
|
||||||
return (None, "Package ID mismatch")
|
return (None, "Package ID mismatch")
|
||||||
if not version:
|
if not version:
|
||||||
return (None,"Couldn't find latest version name")
|
return (None, "Couldn't find latest version name")
|
||||||
if not vercode:
|
if not vercode:
|
||||||
return (None,"Couldn't find latest version code")
|
return (None, "Couldn't find latest version code")
|
||||||
|
|
||||||
vercode = str(int(vercode))
|
vercode = str(int(vercode))
|
||||||
|
|
||||||
|
@ -686,9 +686,9 @@ def retrieve_string(app_dir, string, xmlfiles=None):
|
|||||||
if xmlfiles is None:
|
if xmlfiles is None:
|
||||||
xmlfiles = []
|
xmlfiles = []
|
||||||
for res_dir in res_dirs:
|
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'):
|
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
|
string_search = None
|
||||||
if string.startswith('@string/'):
|
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 retrieve_string(app_dir, matches.group(1), xmlfiles)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return string.replace("\\'","'")
|
return string.replace("\\'", "'")
|
||||||
|
|
||||||
# Return list of existing files that will be used to find the highest vercode
|
# Return list of existing files that will be used to find the highest vercode
|
||||||
def manifest_paths(app_dir, flavour):
|
def manifest_paths(app_dir, flavour):
|
||||||
@ -776,7 +776,7 @@ def ant_subprojects(root_dir):
|
|||||||
for subpath in subprojects:
|
for subpath in subprojects:
|
||||||
subrelpath = os.path.join(root_dir, subpath)
|
subrelpath = os.path.join(root_dir, subpath)
|
||||||
for p in get_library_references(subrelpath):
|
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:
|
if relp not in subprojects:
|
||||||
subprojects.insert(0, relp)
|
subprojects.insert(0, relp)
|
||||||
return subprojects
|
return subprojects
|
||||||
@ -787,7 +787,7 @@ def remove_debuggable_flags(root_dir):
|
|||||||
for root, dirs, files in os.walk(root_dir):
|
for root, dirs, files in os.walk(root_dir):
|
||||||
if 'AndroidManifest.xml' in files:
|
if 'AndroidManifest.xml' in files:
|
||||||
path = os.path.join(root, 'AndroidManifest.xml')
|
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:
|
if p.returncode != 0:
|
||||||
raise BuildException("Failed to remove debuggable flags of %s" % path)
|
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:
|
if ':' in name:
|
||||||
number, name = name.split(':', 1)
|
number, name = name.split(':', 1)
|
||||||
if '/' in name:
|
if '/' in name:
|
||||||
name, subdir = name.split('/',1)
|
name, subdir = name.split('/', 1)
|
||||||
|
|
||||||
srclib_path = os.path.join('srclibs', name + ".txt")
|
srclib_path = os.path.join('srclibs', name + ".txt")
|
||||||
|
|
||||||
@ -936,7 +936,7 @@ def getsrclib(spec, srclib_dir, srclibpaths=[], subdir=None,
|
|||||||
|
|
||||||
if srclib["Srclibs"]:
|
if srclib["Srclibs"]:
|
||||||
n = 1
|
n = 1
|
||||||
for lib in srclib["Srclibs"].replace(';',',').split(','):
|
for lib in srclib["Srclibs"].replace(';', ',').split(','):
|
||||||
s_tuple = None
|
s_tuple = None
|
||||||
for t in srclibpaths:
|
for t in srclibpaths:
|
||||||
if t[0] == lib:
|
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',
|
's@compileSdkVersion *[0-9]*@compileSdkVersion '+n+'@g',
|
||||||
'build.gradle'], cwd=root_dir)
|
'build.gradle'], cwd=root_dir)
|
||||||
if '@' in build['gradle']:
|
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)
|
gradle_dir = os.path.normpath(gradle_dir)
|
||||||
FDroidPopen(['sed', '-i',
|
FDroidPopen(['sed', '-i',
|
||||||
's@compileSdkVersion *[0-9]*@compileSdkVersion '+n+'@g',
|
'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
|
return path.endswith('/%s' % dirname) or '/%s/' % dirname in path
|
||||||
|
|
||||||
# Iterate through all files in the source code
|
# 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')):
|
if any(insidedir(r, d) for d in ('.hg', '.git', '.svn', '.bzr')):
|
||||||
continue
|
continue
|
||||||
@ -1417,7 +1417,7 @@ class KnownApks:
|
|||||||
else:
|
else:
|
||||||
apps[appid] = added
|
apps[appid] = added
|
||||||
sortedapps = sorted(apps.iteritems(), key=operator.itemgetter(1))[-num:]
|
sortedapps = sorted(apps.iteritems(), key=operator.itemgetter(1))[-num:]
|
||||||
lst = [app for app,_ in sortedapps]
|
lst = [app for app, _ in sortedapps]
|
||||||
lst.reverse()
|
lst.reverse()
|
||||||
return lst
|
return lst
|
||||||
|
|
||||||
@ -1566,7 +1566,7 @@ def remove_signing_keys(build_dir):
|
|||||||
continue
|
continue
|
||||||
o.write(line)
|
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):
|
def replace_config_vars(cmd):
|
||||||
cmd = cmd.replace('$$SDK$$', config['sdk_path'])
|
cmd = cmd.replace('$$SDK$$', config['sdk_path'])
|
||||||
@ -1589,10 +1589,10 @@ def place_srclib(root_dir, number, libpath):
|
|||||||
placed = False
|
placed = False
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.startswith('android.library.reference.%d=' % number):
|
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
|
placed = True
|
||||||
else:
|
else:
|
||||||
o.write(line)
|
o.write(line)
|
||||||
if not placed:
|
if not placed:
|
||||||
o.write('android.library.reference.%d=%s\n' % (number,relpath))
|
o.write('android.library.reference.%d=%s\n' % (number, relpath))
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ def main():
|
|||||||
lastcommit, app['Update Check Mode']))
|
lastcommit, app['Update Check Mode']))
|
||||||
|
|
||||||
# No proper license
|
# No proper license
|
||||||
if app['License'] in ('Unknown','None',''):
|
if app['License'] in ('Unknown', 'None', ''):
|
||||||
warn("License was not set")
|
warn("License was not set")
|
||||||
|
|
||||||
# Summary size limit
|
# Summary size limit
|
||||||
|
@ -363,7 +363,7 @@ def description_wiki(lines):
|
|||||||
|
|
||||||
# Parse multiple lines of description as written in a metadata file, returning
|
# Parse multiple lines of description as written in a metadata file, returning
|
||||||
# a single string in HTML format.
|
# a single string in HTML format.
|
||||||
def description_html(lines,linkres):
|
def description_html(lines, linkres):
|
||||||
ps = DescriptionFormatter(linkres)
|
ps = DescriptionFormatter(linkres)
|
||||||
for line in lines:
|
for line in lines:
|
||||||
ps.parseline(line)
|
ps.parseline(line)
|
||||||
@ -394,7 +394,7 @@ def parse_srclib(metafile, **kw):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
field, value = line.split(':',1)
|
field, value = line.split(':', 1)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise MetaDataException("Invalid metadata in %s:%d" % (line, n))
|
raise MetaDataException("Invalid metadata in %s:%d" % (line, n))
|
||||||
|
|
||||||
@ -507,7 +507,7 @@ def parse_metadata(metafile):
|
|||||||
t = flagtype(pk)
|
t = flagtype(pk)
|
||||||
if t == 'list':
|
if t == 'list':
|
||||||
# Port legacy ';' separators
|
# 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':
|
elif t == 'string':
|
||||||
thisbuild[pk] = pv
|
thisbuild[pk] = pv
|
||||||
elif t == 'script':
|
elif t == 'script':
|
||||||
@ -610,7 +610,7 @@ def parse_metadata(metafile):
|
|||||||
curcomments.append(line)
|
curcomments.append(line)
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
field, value = line.split(':',1)
|
field, value = line.split(':', 1)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise MetaDataException("Invalid metadata in "+linedesc)
|
raise MetaDataException("Invalid metadata in "+linedesc)
|
||||||
if field != field.strip() or value != value.strip():
|
if field != field.strip() or value != value.strip():
|
||||||
@ -633,7 +633,7 @@ def parse_metadata(metafile):
|
|||||||
elif fieldtype == 'string':
|
elif fieldtype == 'string':
|
||||||
thisinfo[field] = value
|
thisinfo[field] = value
|
||||||
elif fieldtype == 'list':
|
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':
|
elif fieldtype == 'build':
|
||||||
if value.endswith("\\"):
|
if value.endswith("\\"):
|
||||||
mode = 2
|
mode = 2
|
||||||
|
@ -152,7 +152,7 @@ def main():
|
|||||||
raise BuildException("Failed to sign application")
|
raise BuildException("Failed to sign application")
|
||||||
|
|
||||||
# Zipalign it...
|
# 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,
|
'-v', '4', apkfile,
|
||||||
os.path.join(output_dir, apkfilename)])
|
os.path.join(output_dir, apkfilename)])
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
|
@ -296,7 +296,7 @@ def resize_icon(iconpath, density):
|
|||||||
else:
|
else:
|
||||||
logging.info("%s is small enough: %s" % im.size)
|
logging.info("%s is small enough: %s" % im.size)
|
||||||
|
|
||||||
except Exception,e:
|
except Exception, e:
|
||||||
logging.error("Failed resizing {0} - {1}".format(iconpath, e))
|
logging.error("Failed resizing {0} - {1}".format(iconpath, e))
|
||||||
|
|
||||||
def resize_all_icons(repodirs):
|
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))
|
os.path.join(get_icon_dir(repodir, density), iconfilename))
|
||||||
empty_densities.remove(density)
|
empty_densities.remove(density)
|
||||||
break
|
break
|
||||||
except Exception,e:
|
except Exception, e:
|
||||||
logging.warn("Failed reading {0} - {1}".format(iconpath, e))
|
logging.warn("Failed reading {0} - {1}".format(iconpath, e))
|
||||||
|
|
||||||
if thisinfo['icons']:
|
if thisinfo['icons']:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user