1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-06 11:00:13 +02:00

make _ always be the gettext function, nothing else

This avoids hard bugs where the _() function gets overidden by a str or
something else.
This commit is contained in:
Hans-Christoph Steiner 2017-10-24 16:48:42 +02:00
parent dd6d4b2012
commit ffc91e301a
4 changed files with 7 additions and 7 deletions

View File

@ -519,7 +519,7 @@ def get_extension(filename):
def has_extension(filename, ext): def has_extension(filename, ext):
_, f_ext = get_extension(filename) _ignored, f_ext = get_extension(filename)
return ext == f_ext return ext == f_ext
@ -1745,7 +1745,7 @@ class KnownApks:
default_date = datetime.utcnow() default_date = datetime.utcnow()
self.apks[apkName] = (app, default_date) self.apks[apkName] = (app, default_date)
self.changed = True self.changed = True
_, added = self.apks[apkName] _ignored, added = self.apks[apkName]
return added return added
def getapp(self, apkname): def getapp(self, apkname):

View File

@ -921,7 +921,7 @@ def _decode_bool(s):
def parse_metadata(metadatapath, check_vcs=False): def parse_metadata(metadatapath, check_vcs=False):
'''parse metadata file, optionally checking the git repo for metadata first''' '''parse metadata file, optionally checking the git repo for metadata first'''
_, ext = fdroidserver.common.get_extension(metadatapath) _ignored, ext = fdroidserver.common.get_extension(metadatapath)
accepted = fdroidserver.common.config['accepted_formats'] accepted = fdroidserver.common.config['accepted_formats']
if ext not in accepted: if ext not in accepted:
warn_or_exception('"%s" is not an accepted format, convert to: %s' % ( warn_or_exception('"%s" is not an accepted format, convert to: %s' % (
@ -970,7 +970,7 @@ def parse_metadata(metadatapath, check_vcs=False):
else: else:
root_dir = '.' root_dir = '.'
paths = fdroidserver.common.manifest_paths(root_dir, build.gradle) paths = fdroidserver.common.manifest_paths(root_dir, build.gradle)
_, _, app.id = fdroidserver.common.parse_androidmanifests(paths, app) _ignored, _ignored, app.id = fdroidserver.common.parse_androidmanifests(paths, app)
return app return app
@ -1498,7 +1498,7 @@ def write_txt(mf, app):
def write_metadata(metadatapath, app): def write_metadata(metadatapath, app):
_, ext = fdroidserver.common.get_extension(metadatapath) _ignored, ext = fdroidserver.common.get_extension(metadatapath)
accepted = fdroidserver.common.config['accepted_formats'] accepted = fdroidserver.common.config['accepted_formats']
if ext not in accepted: if ext not in accepted:
warn_or_exception('Cannot write "%s", not an accepted format, use: %s' warn_or_exception('Cannot write "%s", not an accepted format, use: %s'

View File

@ -185,7 +185,7 @@ def scan_source(build_dir, build):
continue continue
path_in_build_dir = os.path.relpath(filepath, build_dir) path_in_build_dir = os.path.relpath(filepath, build_dir)
_, ext = common.get_extension(path_in_build_dir) _ignored, ext = common.get_extension(path_in_build_dir)
if ext == 'so': if ext == 'so':
count += handleproblem('shared library', path_in_build_dir, filepath) count += handleproblem('shared library', path_in_build_dir, filepath)

View File

@ -824,7 +824,7 @@ def insert_localized_app_metadata(apps):
locale = segments[-2] locale = segments[-2]
destdir = os.path.join('repo', packageName, locale) destdir = os.path.join('repo', packageName, locale)
for f in glob.glob(os.path.join(root, d, '*.*')): for f in glob.glob(os.path.join(root, d, '*.*')):
_, extension = common.get_extension(f) _ignored, extension = common.get_extension(f)
if extension in ALLOWED_EXTENSIONS: if extension in ALLOWED_EXTENSIONS:
screenshotdestdir = os.path.join(destdir, d) screenshotdestdir = os.path.join(destdir, d)
os.makedirs(screenshotdestdir, mode=0o755, exist_ok=True) os.makedirs(screenshotdestdir, mode=0o755, exist_ok=True)