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:
parent
dd6d4b2012
commit
ffc91e301a
@ -519,7 +519,7 @@ def get_extension(filename):
|
||||
|
||||
|
||||
def has_extension(filename, ext):
|
||||
_, f_ext = get_extension(filename)
|
||||
_ignored, f_ext = get_extension(filename)
|
||||
return ext == f_ext
|
||||
|
||||
|
||||
@ -1745,7 +1745,7 @@ class KnownApks:
|
||||
default_date = datetime.utcnow()
|
||||
self.apks[apkName] = (app, default_date)
|
||||
self.changed = True
|
||||
_, added = self.apks[apkName]
|
||||
_ignored, added = self.apks[apkName]
|
||||
return added
|
||||
|
||||
def getapp(self, apkname):
|
||||
|
@ -921,7 +921,7 @@ def _decode_bool(s):
|
||||
def parse_metadata(metadatapath, check_vcs=False):
|
||||
'''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']
|
||||
if ext not in accepted:
|
||||
warn_or_exception('"%s" is not an accepted format, convert to: %s' % (
|
||||
@ -970,7 +970,7 @@ def parse_metadata(metadatapath, check_vcs=False):
|
||||
else:
|
||||
root_dir = '.'
|
||||
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
|
||||
|
||||
@ -1498,7 +1498,7 @@ def write_txt(mf, 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']
|
||||
if ext not in accepted:
|
||||
warn_or_exception('Cannot write "%s", not an accepted format, use: %s'
|
||||
|
@ -185,7 +185,7 @@ def scan_source(build_dir, build):
|
||||
continue
|
||||
|
||||
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':
|
||||
count += handleproblem('shared library', path_in_build_dir, filepath)
|
||||
|
@ -824,7 +824,7 @@ def insert_localized_app_metadata(apps):
|
||||
locale = segments[-2]
|
||||
destdir = os.path.join('repo', packageName, locale)
|
||||
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:
|
||||
screenshotdestdir = os.path.join(destdir, d)
|
||||
os.makedirs(screenshotdestdir, mode=0o755, exist_ok=True)
|
||||
|
Loading…
Reference in New Issue
Block a user