Skip to content

Commit

Permalink
Adding Transifex capabilities: pull modes
Browse files Browse the repository at this point in the history
  • Loading branch information
lallulli committed Mar 6, 2016
1 parent e5cbc05 commit 085536c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pygettext.py
Expand Up @@ -85,10 +85,12 @@ def tx_push(dir):
os.system('tx push -s -t --skip')
os.chdir(pwd)

def tx_pull(dir):
def tx_pull(dir, mode):
pwd = os.getcwd()
os.chdir(dir)
os.system('tx pull')
c = 'tx pull --mode {}'.format(mode)
print c
os.system(c)
os.chdir(pwd)


Expand All @@ -103,6 +105,10 @@ def tx_pull(dir):
action="store_true", dest="pull", default=False,
help="transifex pull and compile translations",
)
parser.add_option("-m", "--mode",
action="store", dest="mode", type="string", default="translator",
help="for --pull, specify pull mode: translator (default), developer or reviewed",
)
parser.add_option("-t", "--transifex",
action="store_true", dest="transifex", default=False,
help="enable Transifex support (requires configuration file tx.py, ignore other options)")
Expand All @@ -128,7 +134,7 @@ def tx_pull(dir):
w.write(out)

if options.pull:
tx_pull(tx.config['dir'])
tx_pull(tx.config['dir'], options.mode)
execute(tx.config['dir'], '', tx.config['xrc'], tx.config['lang'], tx.config)

if options.push:
Expand Down

0 comments on commit 085536c

Please sign in to comment.