1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-18 20:50:10 +01:00

Fix flake8 E275 missing whitespace after keyword

This commit is contained in:
Jochen Sprickerhof 2022-07-31 09:14:17 +02:00
parent 42ef7c3406
commit eb79522a36
6 changed files with 11 additions and 11 deletions

View File

@ -468,7 +468,7 @@ def read_config(opts=None):
.format(key=k, configname=configname)) .format(key=k, configname=configname))
for configname in confignames_to_delete: for configname in confignames_to_delete:
del(config[configname]) del config[configname]
return config return config
@ -3656,7 +3656,7 @@ def compare_apks(apk1, apk2, tmp_dir, log_dir=None):
'--max-report-size', '12345678', '--max-diff-block-lines', '128', '--max-report-size', '12345678', '--max-diff-block-lines', '128',
'--html', htmlfile, '--text', textfile, '--html', htmlfile, '--text', textfile,
absapk1, absapk2]) != 0: absapk1, absapk2]) != 0:
return("Failed to run diffoscope " + apk1) return "Failed to run diffoscope " + apk1
apk1dir = os.path.join(tmp_dir, apk_badchars.sub('_', apk1[0:-4])) # trim .apk apk1dir = os.path.join(tmp_dir, apk_badchars.sub('_', apk1[0:-4])) # trim .apk
apk2dir = os.path.join(tmp_dir, apk_badchars.sub('_', apk2[0:-4])) # trim .apk apk2dir = os.path.join(tmp_dir, apk_badchars.sub('_', apk2[0:-4])) # trim .apk
@ -3675,17 +3675,17 @@ def compare_apks(apk1, apk2, tmp_dir, log_dir=None):
if set_command_in_config('apktool'): if set_command_in_config('apktool'):
if subprocess.call([config['apktool'], 'd', absapk1, '--output', 'apktool'], if subprocess.call([config['apktool'], 'd', absapk1, '--output', 'apktool'],
cwd=apk1dir) != 0: cwd=apk1dir) != 0:
return("Failed to run apktool " + apk1) return "Failed to run apktool " + apk1
if subprocess.call([config['apktool'], 'd', absapk2, '--output', 'apktool'], if subprocess.call([config['apktool'], 'd', absapk2, '--output', 'apktool'],
cwd=apk2dir) != 0: cwd=apk2dir) != 0:
return("Failed to run apktool " + apk2) return "Failed to run apktool " + apk2
p = FDroidPopen(['diff', '-r', apk1dir, apk2dir], output=False) p = FDroidPopen(['diff', '-r', apk1dir, apk2dir], output=False)
lines = p.output.splitlines() lines = p.output.splitlines()
if len(lines) != 1 or 'META-INF' not in lines[0]: if len(lines) != 1 or 'META-INF' not in lines[0]:
if set_command_in_config('meld'): if set_command_in_config('meld'):
p = FDroidPopen([config['meld'], apk1dir, apk2dir], output=False) p = FDroidPopen([config['meld'], apk1dir, apk2dir], output=False)
return("Unexpected diff output:\n" + p.output) return "Unexpected diff output:\n" + p.output
# since everything verifies, delete the comparison to keep cruft down # since everything verifies, delete the comparison to keep cruft down
shutil.rmtree(apk1dir) shutil.rmtree(apk1dir)

View File

@ -1017,7 +1017,7 @@ def v1_sort_packages(packages, fdroid_signing_key_fingerprints):
if package.get('versionCode', None): if package.get('versionCode', None):
versionCode = -int(package['versionCode']) versionCode = -int(package['versionCode'])
return(packageName, group, signer, versionCode) return packageName, group, signer, versionCode
packages.sort(key=v1_sort_keys) packages.sort(key=v1_sort_keys)

View File

@ -816,7 +816,7 @@ def parse_yaml_metadata(mf, app):
"metadata because it is deprecated.") "metadata because it is deprecated.")
.format(field=deprecated_field, .format(field=deprecated_field,
metapath=mf.name)) metapath=mf.name))
del(yamldata[deprecated_field]) del yamldata[deprecated_field]
if yamldata.get('Builds', None): if yamldata.get('Builds', None):
for build in yamldata.get('Builds', []): for build in yamldata.get('Builds', []):

View File

@ -751,9 +751,9 @@ def insert_funding_yml_donation_links(apps):
app['OpenCollective'] = s app['OpenCollective'] = s
if not app.get('Donate'): if not app.get('Donate'):
if 'liberapay' in data: if 'liberapay' in data:
del(data['liberapay']) del data['liberapay']
if 'open_collective' in data: if 'open_collective' in data:
del(data['open_collective']) del data['open_collective']
# this tuple provides a preference ordering # this tuple provides a preference ordering
for k in ('custom', 'github', 'patreon', 'community_bridge', 'ko_fi', 'issuehunt'): for k in ('custom', 'github', 'patreon', 'community_bridge', 'ko_fi', 'issuehunt'):
v = data.get(k) v = data.get(k)

View File

@ -133,7 +133,7 @@ elif os.path.exists('makebs.config.py'):
# this is the old name for the config file # this is the old name for the config file
exec(compile(open('makebs.config.py').read(), 'makebs.config.py', 'exec'), config) exec(compile(open('makebs.config.py').read(), 'makebs.config.py', 'exec'), config)
if '__builtins__' in config: if '__builtins__' in config:
del(config['__builtins__']) # added by compile/exec del config['__builtins__'] # added by compile/exec
logging.debug("makebuildserver.config.py parsed -> %s", json.dumps(config, indent=4, sort_keys=True)) logging.debug("makebuildserver.config.py parsed -> %s", json.dumps(config, indent=4, sort_keys=True))
if config['basebox'] == BASEBOX_DEFAULT and 'basebox_version' not in config: if config['basebox'] == BASEBOX_DEFAULT and 'basebox_version' not in config:
config['basebox_version'] = BASEBOX_VERSION_DEFAULT config['basebox_version'] = BASEBOX_VERSION_DEFAULT

View File

@ -319,7 +319,7 @@ class UpdateTest(unittest.TestCase):
repoapps['info.guardianproject.urzip']['localized']['en-US']['name']) repoapps['info.guardianproject.urzip']['localized']['en-US']['name'])
self.assertIsNone(repoapps['obb.mainpatch.current'].get('Name')) self.assertIsNone(repoapps['obb.mainpatch.current'].get('Name'))
del(repoapps['info.guardianproject.urzip']['localized']) del repoapps['info.guardianproject.urzip']['localized']
fdroidserver.update.insert_missing_app_names_from_apks(repoapps, apks) fdroidserver.update.insert_missing_app_names_from_apks(repoapps, apks)
self.assertEqual('urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234', self.assertEqual('urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234',
repoapps['info.guardianproject.urzip']['localized']['en-US']['name']) repoapps['info.guardianproject.urzip']['localized']['en-US']['name'])