Commit Graph

2480 Commits

Author SHA1 Message Date
Laurent Monin
aa6df14701 Use distutils.spawn.find_executable to find tx (or tx.exe) 2014-03-06 23:09:42 +01:00
Laurent Monin
40d86a349c Use SystemExit() instance to set code together with message. 2014-03-06 23:09:42 +01:00
Laurent Monin
f4890ae6cb Not only maintainers can update picard.pot, everybody can. 2014-03-06 23:09:42 +01:00
Laurent Monin
f4ca571d48 Clarify the percentage thing. 2014-03-06 23:09:42 +01:00
Laurent Monin
23051a969a No need to know how countries.pot is generated.
Keep a pointer to the project which updates it though.
2014-03-06 23:09:42 +01:00
Laurent Monin
5ebe6419d2 Remove useless try/except 2014-03-06 23:09:42 +01:00
Laurent Monin
8a4fcc2805 Use a dict for countries instead of a list, and sort before writing to file 2014-03-06 23:09:42 +01:00
Laurent Monin
e52e93f6e1 country_list -> countries 2014-03-06 23:09:42 +01:00
Laurent Monin
608b05bdc9 Use os.path.join() to build path and define it as a variable not a parameter
This method will hardly be called for anything else, having it as parameter
is not needed.
2014-03-06 23:09:42 +01:00
Laurent Monin
848e489dba Only check if we can open po/countries/countries.pot and simplify code 2014-03-06 23:09:42 +01:00
Laurent Monin
cdffc1a404 Use _get_option_name() to insert command-line info in countries.py header
This way, even if option is renamed, comment will be always up-to-date.
2014-03-06 23:09:42 +01:00
Laurent Monin
321b48373c Pass format keyword arguments directly to write_utf8()
'{' and '}' were escaped in `header` and `footer` strings
2014-03-06 23:09:42 +01:00
Laurent Monin
f5197652d2 Add helper _get_option_name() which finds name of the option for current Command
Command class has a get_command_name() but it returns the class's name, not the name
of the option as declared in setup cmdclass dict.
2014-03-06 23:09:41 +01:00
Laurent Monin
2e247a708d _exit_with_error() -> _exit()
Exit with return code and message when needed.
2014-03-06 23:09:41 +01:00
Laurent Monin
213d26f992 Modify _exit_with_error() so message is optional
The Transifex client itself already has very descriptive error message,
so just use return code in `picard_get_po_files()`
2014-03-06 23:09:41 +01:00
Laurent Monin
210c7a2ff1 Pass command as list to subprocess.call() 2014-03-06 23:09:41 +01:00
Laurent Monin
f20cb29b6e Add notice about new setup.py commands 2014-03-06 23:09:41 +01:00
Laurent Monin
e15a3d618f update_countries doesn't update related translations anymore
It just downloads countries.pot as it is all what it is needed to rebuild
countries.py

countries/*.po are updated using the get_po_files command.
2014-03-06 23:09:41 +01:00
Laurent Monin
6c809fcc01 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.
2014-03-06 23:09:41 +01:00
Laurent Monin
ba8178e894 Force download of all .po files when using get_po_files command 2014-03-06 23:09:41 +01:00
Laurent Monin
cdc5b338a0 Download only countries.pot to regenerate countries.py 2014-03-06 23:09:41 +01:00
Laurent Monin
3442ba96e4 Use list to handle tx pull options 2014-03-06 23:09:41 +01:00
Laurent Monin
c6154bc573 Move information about translations to po/README.md 2014-03-06 23:09:41 +01:00
Laurent Monin
8000243d8b Add regen_pot_file command to setup.py
It is using Babel's Distutils Integration command `extract_messages`
instead of pybabel command line command.

See: http://babel.pocoo.org/docs/setup/
2014-03-06 23:09:41 +01:00
Laurent Monin
74c2fedcd3 Add helper _exit_with_error() which log and exit with return code 2014-03-06 23:09:41 +01:00
Laurent Monin
2f7c83f28d Regenerate countries.py from updated countries.pot 2014-03-06 23:09:40 +01:00
Laurent Monin
395cdeaa66 Warn if no country code was found, ie. when file format changed. 2014-03-06 23:09:40 +01:00
Laurent Monin
3468dddd4f Update countries.pot parser since format changed (iso_code -> iso.code)
It changed in https://bitbucket.org/metabrainz/musicbrainz-server/pull-request/426/mbs-6373-only-translate-and-extract-area/diff
2014-03-06 23:09:40 +01:00
Laurent Monin
5aacfe2880 Use a constant for common options of tx pull 2014-03-06 23:09:40 +01:00
Laurent Monin
bafe8fac13 Add command get_po_files to setup.py
It runs tx pull with needed options.
Translations with less than 5% translated are ignored.
2014-03-06 23:09:40 +01:00
Laurent Monin
401dabc66d Build, install and use all available locales
Drop the use of UI_LANGUAGES in setup.py which was restricting available translations,
even though translation was available from transifex.

Locales not in UI_LANGUAGES cannot be selected from Picard Advanced UI option,
but will be used if it is set to system default.
2014-03-06 23:09:40 +01:00
Frederik "Freso" S. Olesen
ce7c32025d Use ungettext_countries() for translating country names. 2014-03-06 23:09:40 +01:00
Frederik "Freso" S. Olesen
1165b03543 Replace the release countries in const.py with import from countries.py. 2014-03-06 23:09:40 +01:00
Laurent Monin
2018154f84 Add generated picard/countries.py 2014-03-06 23:09:40 +01:00
Laurent Monin
770c0e7bde Add po/countries/countries.pot to git ignore list
We don't want this one to be committed to git repo, it is not created
by parsing Picard code.
2014-03-06 23:09:40 +01:00
Laurent Monin
55c8468c80 Add a update_countries command to setup.py
It retrieves countries.pot from transifex and uses it to generated picard/countries.py
2014-03-06 23:09:40 +01:00
Laurent Monin
a94c76be49 Add note to NEWS.txt about PICARD-205 being fixed. 2014-03-06 23:09:40 +01:00
Frederik "Freso" S. Olesen
c24aac4aa8 Build picard-countries.po for enabled languages. 2014-03-06 23:09:40 +01:00
Frederik "Freso" S. Olesen
24881451fb Set up Transifex to pull the country name translations. 2014-03-06 23:09:40 +01:00
Wieland Hoffmann
8fc100c40d Use getopt.gnu_getopt
If you were ever annoyed by starting Picard from the console with a
specific folder, noticing you forgot the `-d`, stopping Picard, pressing
arrow-up, adding the `-d` to the end of the line, only to notice that
this didn't help at all, this commit is for you because now the option
parsing doesn't stop after the first thing that's not an option.
2014-03-06 23:09:39 +01:00
Wieland Hoffmann
aff7b1f045 Delete cover files after running TestCoverArt 2014-01-30 17:26:49 +01:00
Wieland Hoffmann
b2caf38dcc Use a _delete method for deleting temporary image files
__del__ was not getting called reliably when the interpreter shut down.
2014-01-30 17:22:11 +01:00
Wieland Hoffmann
9a4753109e Use md5 hashes to make sure every images is only saved once
make_and_add_image will use already existing images from Tagger.images
if the hash of the image is the same as that of an image in there.
2014-01-30 17:19:24 +01:00
Wieland Hoffmann
841fe9e522 Remove a super(...).__del__ call
`object` does not actually have a __del__ method
2014-01-30 00:54:09 +01:00
Wieland Hoffmann
23634fe8ee Use tempfile.mkstemp to get a closable tempfile
This makes sure we don't run out of file descriptors if many images get
loaded into Picard.
2014-01-29 19:38:02 +01:00
Wieland Hoffmann
fd4c31c10a tis -> this 2014-01-23 11:18:38 +01:00
Wieland Hoffmann
e0b99f44e5 Fix embedding only front images
by using the images is_front_image attribute
2014-01-23 11:17:49 +01:00
Wieland Hoffmann
8930778a50 Fix a typo
Not sure how that happened.
2014-01-23 00:49:58 +01:00
Wieland Hoffmann
1caf084685 Catch IOErrors and OSErrors when creating Images
They can happen if the disk is full or the user is not allowed to access
the folder where tempfile.TemporaryFile wants to create the file.
2014-01-23 00:08:58 +01:00
Wieland Hoffmann
030fb9b00b Use the same Image objects for all tracks of an album 2014-01-22 23:28:54 +01:00