mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-04 07:33:59 +00:00
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:
@@ -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
|
||||
```
|
||||
|
||||
12
setup.py
12
setup.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user