mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
server: move strings to be gettext translatable
This commit is contained in:
parent
a4c4a16ed9
commit
0c4dc9779e
1 changed files with 15 additions and 11 deletions
|
|
@ -69,7 +69,8 @@ def update_awsbucket_s3cmd(repo_section):
|
||||||
to use a full MD5 checksum of all files to detect changes.
|
to use a full MD5 checksum of all files to detect changes.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
logging.debug('using s3cmd to sync with ' + config['awsbucket'])
|
logging.debug(_('Using s3cmd to sync with: {url}')
|
||||||
|
.format(url=config['awsbucket']))
|
||||||
|
|
||||||
configfilename = '.s3cfg'
|
configfilename = '.s3cfg'
|
||||||
fd = os.open(configfilename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY, 0o600)
|
fd = os.open(configfilename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY, 0o600)
|
||||||
|
|
@ -129,7 +130,8 @@ def update_awsbucket_libcloud(repo_section):
|
||||||
Requires AWS credentials set in config.py: awsaccesskeyid, awssecretkey
|
Requires AWS credentials set in config.py: awsaccesskeyid, awssecretkey
|
||||||
'''
|
'''
|
||||||
|
|
||||||
logging.debug('using Apache libcloud to sync with ' + config['awsbucket'])
|
logging.debug(_('using Apache libcloud to sync with {url}')
|
||||||
|
.format(url=config['awsbucket']))
|
||||||
|
|
||||||
import libcloud.security
|
import libcloud.security
|
||||||
libcloud.security.VERIFY_SSL_CERT = True
|
libcloud.security.VERIFY_SSL_CERT = True
|
||||||
|
|
@ -138,7 +140,7 @@ def update_awsbucket_libcloud(repo_section):
|
||||||
|
|
||||||
if not config.get('awsaccesskeyid') or not config.get('awssecretkey'):
|
if not config.get('awsaccesskeyid') or not config.get('awssecretkey'):
|
||||||
raise FDroidException(
|
raise FDroidException(
|
||||||
'To use awsbucket, you must set awssecretkey and awsaccesskeyid in config.py!')
|
_('To use awsbucket, awssecretkey and awsaccesskeyid must also be set in config.py!'))
|
||||||
awsbucket = config['awsbucket']
|
awsbucket = config['awsbucket']
|
||||||
|
|
||||||
cls = get_driver(Provider.S3)
|
cls = get_driver(Provider.S3)
|
||||||
|
|
@ -147,7 +149,8 @@ def update_awsbucket_libcloud(repo_section):
|
||||||
container = driver.get_container(container_name=awsbucket)
|
container = driver.get_container(container_name=awsbucket)
|
||||||
except ContainerDoesNotExistError:
|
except ContainerDoesNotExistError:
|
||||||
container = driver.create_container(container_name=awsbucket)
|
container = driver.create_container(container_name=awsbucket)
|
||||||
logging.info('Created new container "' + container.name + '"')
|
logging.info(_('Created new container "{name}"')
|
||||||
|
.format(name=container.name))
|
||||||
|
|
||||||
upload_dir = 'fdroid/' + repo_section
|
upload_dir = 'fdroid/' + repo_section
|
||||||
objs = dict()
|
objs = dict()
|
||||||
|
|
@ -403,7 +406,7 @@ def update_servergitmirrors(servergitmirrors, repo_section):
|
||||||
repo.git.add(all=True)
|
repo.git.add(all=True)
|
||||||
repo.index.commit("fdroidserver git-mirror: Deploy to GitLab Pages")
|
repo.index.commit("fdroidserver git-mirror: Deploy to GitLab Pages")
|
||||||
|
|
||||||
logging.debug('Pushing to ' + remote.url)
|
logging.debug(_('Pushing to {url}').format(url=remote.url))
|
||||||
with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
|
with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
|
||||||
pushinfos = remote.push('master', force=True, set_upstream=True, progress=progress)
|
pushinfos = remote.push('master', force=True, set_upstream=True, progress=progress)
|
||||||
for pushinfo in pushinfos:
|
for pushinfo in pushinfos:
|
||||||
|
|
@ -540,7 +543,8 @@ def push_binary_transparency(git_repo_path, git_remote):
|
||||||
'''
|
'''
|
||||||
import git
|
import git
|
||||||
|
|
||||||
logging.info('Pushing binary transparency log to ' + git_remote)
|
logging.info(_('Pushing binary transparency log to {url}')
|
||||||
|
.format(url=git_remote))
|
||||||
|
|
||||||
if os.path.isdir(os.path.dirname(git_remote)):
|
if os.path.isdir(os.path.dirname(git_remote)):
|
||||||
# from offline machine to thumbdrive
|
# from offline machine to thumbdrive
|
||||||
|
|
@ -628,17 +632,17 @@ def main():
|
||||||
logging.error(_('local_copy_dir must be directory, not a file!'))
|
logging.error(_('local_copy_dir must be directory, not a file!'))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if not os.path.exists(os.path.dirname(fdroiddir)):
|
if not os.path.exists(os.path.dirname(fdroiddir)):
|
||||||
logging.error('The root dir for local_copy_dir "'
|
logging.error(_('The root dir for local_copy_dir "{path}" does not exist!')
|
||||||
+ os.path.dirname(fdroiddir)
|
.format(path=os.path.dirname(fdroiddir)))
|
||||||
+ '" does not exist!')
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if not os.path.isabs(fdroiddir):
|
if not os.path.isabs(fdroiddir):
|
||||||
logging.error(_('local_copy_dir must be an absolute path!'))
|
logging.error(_('local_copy_dir must be an absolute path!'))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
repobase = os.path.basename(fdroiddir)
|
repobase = os.path.basename(fdroiddir)
|
||||||
if standardwebroot and repobase != 'fdroid':
|
if standardwebroot and repobase != 'fdroid':
|
||||||
logging.error('local_copy_dir does not end with "fdroid", '
|
logging.error(_('local_copy_dir does not end with "fdroid", '
|
||||||
+ 'perhaps you meant: ' + fdroiddir + '/fdroid')
|
+ 'perhaps you meant: "{path}"')
|
||||||
|
.format(path=fdroiddir + '/fdroid'))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if local_copy_dir[-1] != '/':
|
if local_copy_dir[-1] != '/':
|
||||||
local_copy_dir += '/'
|
local_copy_dir += '/'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue