summaryrefslogtreecommitdiffstats
path: root/Tools/i18n/pygettext.py
Commit message (Collapse)AuthorAgeFilesLines
* Update URLs in comments and metadata to use HTTPS (GH-27458)Noah Kantrowitz2021-07-301-2/+2
|
* bpo-36310: Allow pygettext.py to detect calls to gettext in f-strings. ↵jack11422020-11-091-0/+53
| | | | | | | (GH-19875) Adds support to Tools/i18n/pygettext.py for gettext calls in f-strings. This process is done by parsing the f-strings, processing each value, and flagging the ones which contain a gettext call. Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-22831: Use "with" to avoid possible fd leaks in tools (part 2). (GH-10927)Serhiy Storchaka2019-03-301-3/+2
|
* bpo-33189: pygettext.py now accepts only literal strings (GH-6364)Serhiy Storchaka2018-04-191-5/+9
| | | | as docstrings and translatable strings, and rejects bytes literals and f-string expressions.
* bpo-31920: Fixed handling directories as arguments in the ``pygettext`` ↵Serhiy Storchaka2018-04-091-19/+11
| | | | | script. (GH-6259) Based on patch by Oleg Krasnikov.
* bpo-32222: Fix pygettext skipping docstrings for funcs with arg typehints ↵Tobotimus2018-02-261-4/+11
| | | | (GH-4745)
* Merge spelling and grammar fixes from 3.5Martin Panter2016-08-051-1/+1
|\
| * Fix spelling and grammar in documentation and code commentsMartin Panter2016-08-041-1/+1
| |
* | Update pygettext.py to get ride of impVictor Stinner2016-04-121-43/+8
|/ | | | | | Issue #26639: Replace imp with importlib in Tools/i18n/pygettext.py. Remove _get_modpkg_path(), replaced with importlib.util.find_spec().
* #18128: use standard +NNNN timezone format in POT-Creation-Date header.R David Murray2015-04-161-3/+1
| | | | Patch by Michael McFadden, with a few small style tweaks.
* update Barry's email (#19563)Benjamin Peterson2013-12-231-1/+1
|
* Issue #17156: pygettext.py now uses an encoding of source file and correctlySerhiy Storchaka2013-02-091-33/+33
|\ | | | | | | writes and escapes non-ascii characters.
| * Issue #17156: pygettext.py now uses an encoding of source file and correctlySerhiy Storchaka2013-02-091-33/+33
| | | | | | | | writes and escapes non-ascii characters.
* | Some cleanup in the Tools directory.Florent Xicluna2012-07-071-1/+0
|/
* convert shebang lines: python -> python3Benjamin Peterson2010-03-111-1/+1
|
* More 2to3 fixes in the Tools directory. Fixes #2893.Georg Brandl2008-05-161-1/+1
|
* Removed remnants of os.path.walk().Alexandre Vassalotti2008-05-091-1/+1
|
* - Issue #719888: Updated tokenize to use a bytes API. generate_tokens has beenTrent Nelson2008-03-181-1/+3
| | | | | | | | | | renamed tokenize and now works with bytes rather than strings. A new detect_encoding function has been added for determining source file encoding according to PEP-0263. Token sequences returned by tokenize always start with an ENCODING token which specifies the encoding used to decode the file. This token is used to encode the output of untokenize back to bytes. Credit goes to Michael "I'm-going-to-name-my-first-child-unittest" Foord from Resolver Systems for this work.
* Patch #1830 by Peter Harris, fix some 2.x-isms.Guido van Rossum2008-01-151-7/+3
|
* In followup to #1310: Remove more exception indexing.Georg Brandl2007-10-221-1/+2
|
* Convert print statements to function calls in Tools/.Collin Winter2007-08-031-19/+19
|
* SF patch 1631942 by Collin Winter:Guido van Rossum2007-01-101-2/+2
| | | | | | (a) "except E, V" -> "except E as V" (b) V is now limited to a simple name (local variable) (c) V is now deleted at the end of the except block
* Kill reduce(). A coproduction of John Reese, Jacques Frechet, and Alex M.Guido van Rossum2006-08-221-3/+1
|
* - pygettext.py: Generate POT-Creation-Date header in ISO format.Matthias Klose2004-08-161-1/+1
|
* Mostly reformatting, splitting long lines, whitespace normalizationBarry Warsaw2003-04-161-33/+35
| | | | | | etc. Fixed one typo in the __main__ section.
* Patch #494845: Support string concatenation, detect non-string data,Martin v. Löwis2002-11-221-37/+163
| | | | add globbing support, find modules by name instead of by file.
* Added the -X/--no-docstrings flag which takes a filename containing aBarry Warsaw2001-07-271-13/+32
| | | | | | | | | | | | | | | | | | | | | | | list of files to not extract docstrings from when the -D option is given. This isn't optimal, but I didn't want to change the semantics of -D, and it's bad form to allow optional switch arguments. Bumping __version__ to 1.4. TokenEater.__init__(): Initialize __curfile to None. __waiting(): In order to extract docstrings from the module, both the -D flag should be set, and the __curfile should not be named in the -X filename (i.e. it isn't in opts.nodocstrings). set_filename(): Fixed a bug where once the first module docstring is extracted, no subsequent module docstrings will be extracted. The bug was that the first extraction set __freshmodule to 0, but that flag was never reset back to 1. set_filename() is always called when the next file is being processed, so use it to reset the __freshmodule flag. main(): Add support for -X/--no-docstring.
* write(): Karl Eichwalder points out that the #, flag comments shouldBarry Warsaw2001-06-201-1/+4
| | | | be outputted just before the msgid lines.
* write(): It's been generally agreed on the i18n-sig that the docstringBarry Warsaw2001-06-191-1/+1
| | | | marker should be output as a #, flag, e.g. "#, docstring".
* write(): Aggressively sort all catalog entries, and fix the bug whereBarry Warsaw2001-05-241-35/+37
| | | | | there were multiple translatable strings on a single line of source code.
* write(): Do two levels of sorting: first sort the individual locationBarry Warsaw2001-05-231-0/+10
| | | | | tuples by filename/lineno, then sort the catalog entries by their location tuples.
* main(): default-domain argument to getopt.getopt() was missing a = toBarry Warsaw2001-05-211-1/+1
| | | | | indicate it took an argument. This closes SF patch #402223 by Bastian Kleineidam.
* __addentry(): add optional keyword arg `isdocstring' which is a flagBarry Warsaw2001-05-211-4/+10
| | | | | | | | | | | indicating whether the entry was extracted from a docstring or not. write(): If any of the locations of a string appearance came from a docstring, add a comment such as #. docstring before the references (after a suggestion by Martin von Loewis).
* write(): A patch inspired by Tokio Kikuchi that sorts location entriesBarry Warsaw2001-05-211-7/+12
| | | | | | first by filename and then by line number. Closes SF patch #425821. Also, fixes a problem with duplicate entries.
* Put current date into POT-Creation-Date; leave PO-Revision-Date forMartin v. Löwis2001-03-011-2/+3
| | | | for the translator to update; that is compatible with xgettext 0.10.35.
* main(): Slightly more informative error message when TokenErrorBarry Warsaw2001-02-261-1/+5
| | | | occurs. Also, continue processing.
* Added the -D/--docstrings option for extraction of unmarked module,Barry Warsaw2000-10-271-40/+82
| | | | class, method, and function docstrings.
* Remove bogus stdout redirection and use of sys.__stdout__; useFred Drake2000-10-261-32/+28
| | | | augmented print statement instead.
* Added an unused Unicode string for testing.Barry Warsaw2000-05-021-0/+2
|
* A bunch of changes, primarily to command line argument parsingBarry Warsaw2000-03-081-64/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (inspired by Detlef Lannert). Specifically, -k/--keyword no longer takes an optional argument to clear the default keywords. Instead, use -K/--no-default-keywords to clear them. -n/--add-location also no longer takes an optional argument to set the comment style. Instead, use -S/--style to set the comment style to GNU or Solaris. -o/--output can take `-' as the filename, meaning write to standard output. The inputfile name can also be `-' meaning read from standard in. A few other changes include Kludge to mark the file docstring as translatable. Since the marking is to place _() around the docstring, and because we actually have to define the _() function before we use it, this means that we have to manually assign to __doc__ the output of _(). This doesn't seem too bad because you'll only use this idiom when translating a script's docstring (you really don't need to translate most module docstrings). Convert everything to string methods and do not import the string module. Bump the version number to 1.1
* Two buglet fixes. Peter Funk caught the bug in make_escapes:Barry Warsaw2000-02-271-7/+9
| | | | | | | This will fold all ISO 8859 chars from the upper half of the charset into the lower half, which is ...ummm.... unintened. The second is a typo in the reference to options.escape in main().
* Changes submitted by Peter Funk (some fixes/additions by B.Warsaw) toBarry Warsaw2000-02-261-40/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make pygettext more compatible with GNU xgettext, specifically: Added -E/--escape for allowing pass-thru of iso8859-1 characters above 7 bits. Added -o/--output option for renaming the output file from messages.pot (there's overlap with -d/--default-domain, but GNU xgettext has them both). Added -p/--output-dir for specifying the output directory for messages.pot. Added -V/--version for printing the version number. Added -w/--width for specifying the output page width (this is because now pygettext, like GNU xgettext will put several locations on the same line to cut down on vertical space). Added -x/--exclude-file for specifying a list of strings that are not to be extracted from the input files. Bumped version number to 1.0 Try to import fintl and use fintl.gettext as _ if available. Fall back is to use identity definition of _(). Moved the escape creation to a function make_escapes() so that its behavior can be controlled by the -E option. __openseen(): Support the -x option. write(): Support -w option and vertical space preserving feature. main(): Support new options.
* Added \" to escapes so embedded escaped double quotes are handledBarry Warsaw1999-12-061-0/+1
| | | | correctly. Patch suggested by Mads Kiilerich <mk@solit.dk>.
* Several improvements, some of where were contributed by BernhardBarry Warsaw1999-11-031-44/+86
| | | | | | | | | | | | | | | | Herzog <herzog@online.de>. Specifically, --verbose/-v flag added pot_header added to make msgmerge and Emacs po-mode work better normalize(), escape(), safe_eval(): Improved normalization of strings for more .po file compatibility (e.g. C style). Handles emmbedded newlines better. Also added an identity function called _() and use it in the file where messages are printed. This allows us to selftest pygettext.py with itself as input.
* Python equivalent of xgettext(1). This was originally releasedBarry Warsaw1999-11-031-0/+1
| | | | separately but now is included in the standard Python distribution.
* Initial implementationBarry Warsaw1999-08-131-0/+268
|
* Initial revisionBarry Warsaw1999-08-111-0/+1