Add an option to get_po_files to override default minimun percentage

Update po/README.md so the actual value isn't written, if we change the default value
it will be only at once place.
This commit is contained in:
Laurent Monin
2014-01-13 01:48:19 +01:00
parent b6a876afed
commit 2e275ca16b
2 changed files with 14 additions and 5 deletions

View File

@@ -48,4 +48,9 @@ Use the following command:
$ python setup.py get_po_files
```
It will fetch all po files from Transifex with at least 5% translations done (this is defined by `TXPULL_CMD` in `setup.py`).
It will fetch all po files from Transifex, but the most incomplete ones.
This default minimum percentage can be seen using:
```bash
$ python setup.py get_po_files --help
```

View File

@@ -313,20 +313,24 @@ class picard_clean_ui(Command):
class picard_get_po_files(Command):
description = "Retrieve po files from transifex"
user_options = []
minimum_perc_default = 5
user_options = [
('minimum-perc=', 'm',
"Specify the minimum acceptable percentage of a translation (default: %d)" % minimum_perc_default)
]
def initialize_options(self):
pass
self.minimum_perc = self.minimum_perc_default
def finalize_options(self):
pass
self.minimum_perc = int(self.minimum_perc)
def run(self):
txpull_cmd = " ".join([
TXPULL_CMD,
'--force',
'--all',
'--minimum-perc=5',
'--minimum-perc=%d' % self.minimum_perc
])
log.info("Running %s" % txpull_cmd)
retcode = subprocess.call(txpull_cmd, shell=True)