- 15 Dec, 2022 3 commits
-
-
Will Thompson authored
I can't remember what these things do and I wrote all this.
-
- 28 Oct, 2020 1 commit
-
-
Will Thompson authored
-
- 04 Oct, 2019 1 commit
-
-
Will Thompson authored
-
- 13 Aug, 2019 2 commits
-
-
Will Thompson authored
Render them as a single legible message, not a huge traceback, and summarize at the end of the run (along with a non-0 exit status).
-
Will Thompson authored
-
- 25 Jul, 2019 2 commits
-
-
Will Thompson authored
This is useful when a few languages have syntax errors, but you want to process the rest.
-
Will Thompson authored
Previously, on encountering a file that polib cannot parse, there was no indication (without --debug) of which file is causing offence: Traceback (most recent call last): File "../../wjt/translate-o-tron-3000/t3k", line 296, in <module> main() File "../../wjt/translate-o-tron-3000/t3k", line 292, in main args.func(args) File "../../wjt/translate-o-tron-3000/t3k", line 170, in rebase git_show_rev_file(args.git_dir, args.base_rev, rel_path) File "/usr/lib/python3/dist-packages/polib.py", line 139, in pofile return _pofile_or_mofile(pofile, 'pofile', **kwargs) File "/usr/lib/python3/dist-packages/polib.py", line 87, in _pofile_or_mofile instance = parser.parse() File "/usr/lib/python3/dist-packages/polib.py", line 1428, in parse (fpath, self.current_line)) OSError: Syntax error in po file (line 2340) Since we are passing the contents of the file to pofile(), not its path, the 'fpath' visible in the backtrace is the empty string – polib doesn't know what it's called. Even though the (private) POFile constructor accepts a fpath argument to deal with this case, the pofile() wrapper function doesn't pass it through; and it would be cheating to tell it a path that is not actually an on-disk file. Rather than materializing the file, we can just include the revision and path ourselves: Traceback (most recent call last): File "../../wjt/translate-o-tron-3000/t3k", line 158, in _parse_pofile_at_rev return polib.pofile(contents) File "/usr/lib/python3/dist-packages/polib.py", line 139, in pofile return _pofile_or_mofile(pofile, 'pofile', **kwargs) File "/usr/lib/python3/dist-packages/polib.py", line 87, in _pofile_or_mofile instance = parser.parse() File "/usr/lib/python3/dist-packages/polib.py", line 1428, in parse (fpath, self.current_line)) OSError: Syntax error in po file (line 2340) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "../../wjt/translate-o-tron-3000/t3k", line 309, in <module> main() File "../../wjt/translate-o-tron-3000/t3k", line 305, in main args.func(args) File "../../wjt/translate-o-tron-3000/t3k", line 185, in rebase base = _parse_pofile_at_rev(args.git_dir, args.base_rev, rel_path) File "../../wjt/translate-o-tron-3000/t3k", line 160, in _parse_pofile_at_rev raise IOError(f"Failed to parse {rev_filename}") from exc OSError: Failed to parse 3.26.7:po/ca.po
-
- 24 Jun, 2019 5 commits
-
-
Will Thompson authored
This makes instructions easier to write.
-
Will Thompson authored
-
Will Thompson authored
-
Will Thompson authored
-
Will Thompson authored
t3k for short.
-
- 21 Jun, 2019 1 commit
-
-
Will Thompson authored
-