mirror of
https://gitlab.com/openlp/packaging.git
synced 2024-12-22 04:52:50 +00:00
Add cli options to specify transifex login on command line.
This commit is contained in:
parent
d4d0559a7c
commit
caa0e5e90c
@ -225,6 +225,10 @@ class MacosxBuilder(object):
|
||||
parser.add_argument('--transifex',
|
||||
dest='update_translations', action='store_true', default=False,
|
||||
help='Update the language translation from Transifex.')
|
||||
parser.add_argument('--transifex-user',
|
||||
dest='transifex_user', help='Transifex username.')
|
||||
parser.add_argument('--transifex-pass',
|
||||
dest='transifex_pass', help='Transifex password.')
|
||||
parser.add_argument('-v', '--verbose', dest='verbose',
|
||||
action='store_true', default=False,
|
||||
help='Print out additional information.')
|
||||
@ -372,8 +376,7 @@ class MacosxBuilder(object):
|
||||
raise Exception(u'Error running bzr log')
|
||||
output_ascii = unicode(output, errors=u'ignore')
|
||||
latest = output_ascii.split(u':')[0]
|
||||
version_string = latest == revision and tag or \
|
||||
u'%s-bzr%s' % (tag, latest)
|
||||
version_string = u'%s-bzr%s' % (tag, latest)
|
||||
self.version_string = version_string
|
||||
self.version_tag = tag
|
||||
version_file = open(os.path.join(self.dist_path, u'.version'), u'w')
|
||||
@ -452,8 +455,14 @@ class MacosxBuilder(object):
|
||||
raise Exception(u'No option named "username" found.')
|
||||
if not self.config.has_option('transifex', 'password'):
|
||||
raise Exception(u'No option named "password" found.')
|
||||
username = self.config.get(u'transifex', u'username')
|
||||
password = self.config.get(u'transifex', u'password')
|
||||
if self.args.transifex_user:
|
||||
username = self.args.transifex_user
|
||||
else:
|
||||
username = self.config.get(u'transifex', u'username')
|
||||
if self.args.transifex_pass:
|
||||
password = self.args.transifex_pass
|
||||
else:
|
||||
password = self.config.get(u'transifex', u'password')
|
||||
os.chdir(os.path.split(self.i18n_utils)[0])
|
||||
translation_utils = Popen([self.python, self.i18n_utils, u'-qdpu',
|
||||
u'-U', username, u'-P', password])
|
||||
|
Loading…
Reference in New Issue
Block a user