fix PEP8 "E201 whitespace after '(' or '[' or '{'"

This commit is contained in:
Hans-Christoph Steiner 2014-05-01 22:21:47 -04:00
parent 998011d535
commit 4af2e0004f
4 changed files with 34 additions and 34 deletions

View file

@ -53,7 +53,7 @@ def get_default_config():
'Summary': 50, 'Summary': 50,
'Description': 1500 'Description': 1500
}, },
'keyaliases': { }, 'keyaliases': {},
} }
def read_config(opts, config_file='config.py'): def read_config(opts, config_file='config.py'):
@ -709,7 +709,7 @@ def retrieve_string(app_dir, string, xmlfiles=None):
# 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):
possible_manifests = [ os.path.join(app_dir, 'AndroidManifest.xml'), possible_manifests = [os.path.join(app_dir, 'AndroidManifest.xml'),
os.path.join(app_dir, 'src', 'main', 'AndroidManifest.xml'), os.path.join(app_dir, 'src', 'main', 'AndroidManifest.xml'),
os.path.join(app_dir, 'src', 'AndroidManifest.xml'), os.path.join(app_dir, 'src', 'AndroidManifest.xml'),
os.path.join(app_dir, 'build.gradle') ] os.path.join(app_dir, 'build.gradle') ]
@ -1040,9 +1040,9 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
srclibpaths.append(basesrclib) srclibpaths.append(basesrclib)
# Update the local.properties file # Update the local.properties file
localprops = [ os.path.join(build_dir, 'local.properties') ] localprops = [os.path.join(build_dir, 'local.properties') ]
if 'subdir' in build: if 'subdir' in build:
localprops += [ os.path.join(root_dir, 'local.properties') ] localprops += [os.path.join(root_dir, 'local.properties') ]
for path in localprops: for path in localprops:
if not os.path.isfile(path): if not os.path.isfile(path):
continue continue
@ -1364,7 +1364,7 @@ class KnownApks:
self.path = os.path.join('stats', 'known_apks.txt') self.path = os.path.join('stats', 'known_apks.txt')
self.apks = {} self.apks = {}
if os.path.exists(self.path): if os.path.exists(self.path):
for line in file( self.path): for line in file(self.path):
t = line.rstrip().split(' ') t = line.rstrip().split(' ')
if len(t) == 2: if len(t) == 2:
self.apks[t[0]] = (t[1], None) self.apks[t[0]] = (t[1], None)

View file

@ -68,7 +68,7 @@ def main():
if args: if args:
vercodes = common.read_pkg_args(args, True) vercodes = common.read_pkg_args(args, True)
apks = { appid: None for appid in vercodes } apks = {appid: None for appid in vercodes }
# Get the signed apk with the highest vercode # Get the signed apk with the highest vercode
for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))): for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
@ -86,7 +86,7 @@ def main():
else: else:
apks = { common.apknameinfo(apkfile)[0]: apkfile for apkfile in apks = {common.apknameinfo(apkfile)[0]: apkfile for apkfile in
sorted(glob.glob(os.path.join(output_dir, '*.apk'))) } sorted(glob.glob(os.path.join(output_dir, '*.apk'))) }
for appid, apk in apks.iteritems(): for appid, apk in apks.iteritems():

View file

@ -122,63 +122,63 @@ class FieldType():
valuetypes = { valuetypes = {
'int': FieldType("Integer", 'int': FieldType("Integer",
r'^[1-9][0-9]*$', None, r'^[1-9][0-9]*$', None,
[ 'FlattrID' ], ['FlattrID' ],
[ 'vercode' ]), ['vercode' ]),
'http': FieldType("HTTP link", 'http': FieldType("HTTP link",
r'^http[s]?://', None, r'^http[s]?://', None,
[ "Web Site", "Source Code", "Issue Tracker", "Donate" ], []), ["Web Site", "Source Code", "Issue Tracker", "Donate" ], []),
'bitcoin': FieldType("Bitcoin address", 'bitcoin': FieldType("Bitcoin address",
r'^[a-zA-Z0-9]{27,34}$', None, r'^[a-zA-Z0-9]{27,34}$', None,
[ "Bitcoin" ], ["Bitcoin" ],
[ ]), []),
'litecoin': FieldType("Litecoin address", 'litecoin': FieldType("Litecoin address",
r'^L[a-zA-Z0-9]{33}$', None, r'^L[a-zA-Z0-9]{33}$', None,
[ "Litecoin" ], ["Litecoin" ],
[ ]), []),
'dogecoin': FieldType("Dogecoin address", 'dogecoin': FieldType("Dogecoin address",
r'^D[a-zA-Z0-9]{33}$', None, r'^D[a-zA-Z0-9]{33}$', None,
[ "Dogecoin" ], ["Dogecoin" ],
[ ]), []),
'Bool': FieldType("Boolean", 'Bool': FieldType("Boolean",
['Yes', 'No'], None, ['Yes', 'No'], None,
[ "Requires Root" ], ["Requires Root" ],
[ ]), []),
'bool': FieldType("Boolean", 'bool': FieldType("Boolean",
['yes', 'no'], None, ['yes', 'no'], None,
[ ], [],
[ 'submodules', 'oldsdkloc', 'forceversion', 'forcevercode', ['submodules', 'oldsdkloc', 'forceversion', 'forcevercode',
'novcheck' ]), 'novcheck' ]),
'Repo Type': FieldType("Repo Type", 'Repo Type': FieldType("Repo Type",
[ 'git', 'git-svn', 'svn', 'hg', 'bzr', 'srclib' ], None, ['git', 'git-svn', 'svn', 'hg', 'bzr', 'srclib' ], None,
[ "Repo Type" ], ["Repo Type" ],
[ ]), []),
'archive': FieldType("Archive Policy", 'archive': FieldType("Archive Policy",
r'^[0-9]+ versions$', None, r'^[0-9]+ versions$', None,
[ "Archive Policy" ], ["Archive Policy" ],
[ ]), []),
'antifeatures': FieldType("Anti-Feature", 'antifeatures': FieldType("Anti-Feature",
[ "Ads", "Tracking", "NonFreeNet", "NonFreeDep", "NonFreeAdd", "UpstreamNonFree" ], ',', ["Ads", "Tracking", "NonFreeNet", "NonFreeDep", "NonFreeAdd", "UpstreamNonFree" ], ',',
[ "AntiFeatures" ], ["AntiFeatures" ],
[ ]), []),
'autoupdatemodes': FieldType("Auto Update Mode", 'autoupdatemodes': FieldType("Auto Update Mode",
r"^(Version .+|None)$", None, r"^(Version .+|None)$", None,
[ "Auto Update Mode" ], ["Auto Update Mode" ],
[ ]), []),
'updatecheckmodes': FieldType("Update Check Mode", 'updatecheckmodes': FieldType("Update Check Mode",
r"^(Tags|Tags .+|RepoManifest|RepoManifest/.+|RepoTrunk|HTTP|Static|None)$", None, r"^(Tags|Tags .+|RepoManifest|RepoManifest/.+|RepoTrunk|HTTP|Static|None)$", None,
[ "Update Check Mode" ], ["Update Check Mode" ],
[ ]) [])
} }
# Check an app's metadata information for integrity errors # Check an app's metadata information for integrity errors
@ -753,7 +753,7 @@ def write_metadata(dest, app):
mf.write('\n') mf.write('\n')
for build in app['builds']: for build in app['builds']:
writecomments('build:' + build['version']) writecomments('build:' + build['version'])
mf.write("Build:%s,%s\n" % ( build['version'], build['vercode'])) mf.write("Build:%s,%s\n" % (build['version'], build['vercode']))
def write_builditem(key, value): def write_builditem(key, value):
if key in ['version', 'vercode', 'origlines', 'type']: if key in ['version', 'vercode', 'origlines', 'type']:

View file

@ -91,7 +91,7 @@ def update_awsbucket(repo_section):
if upload: if upload:
if options.verbose: if options.verbose:
logging.info(' uploading "' + file_to_upload + '"...') logging.info(' uploading "' + file_to_upload + '"...')
extra = { 'acl': 'public-read' } extra = {'acl': 'public-read' }
if file_to_upload.endswith('.sig'): if file_to_upload.endswith('.sig'):
extra['content_type'] = 'application/pgp-signature' extra['content_type'] = 'application/pgp-signature'
elif file_to_upload.endswith('.asc'): elif file_to_upload.endswith('.asc'):