Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9d1e668

Browse files
authored
gh-129911: pygettext: Fix the keyword entry in help output (GH-129914)
1 parent3bd3e09 commit9d1e668

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

‎Lib/test/test_tools/test_i18n.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,12 @@ def test_files_list(self):
413413
self.assertIn(f'msgid "{text2}"',data)
414414
self.assertNotIn(text3,data)
415415

416+
deftest_help_text(self):
417+
"""Test that the help text is displayed."""
418+
res=assert_python_ok(self.script,'--help')
419+
self.assertEqual(res.out,b'')
420+
self.assertIn(b'pygettext -- Python equivalent of xgettext(1)',res.err)
421+
416422
deftest_error_messages(self):
417423
"""Test that pygettext outputs error messages to stderr."""
418424
stderr=self.get_stderr(dedent('''\
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the keyword entry in the help output of:program:`pygettext`.

‎Tools/i18n/pygettext.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
-k word
6868
--keyword=word
6969
Keywords to look for in addition to the default set, which are:
70-
%(DEFAULTKEYWORDS)s
70+
_, gettext, ngettext, pgettext, npgettext, dgettext, dngettext,
71+
dpgettext, and dnpgettext.
7172
7273
You can have multiple -k flags on the command line.
7374
@@ -169,7 +170,7 @@
169170

170171

171172
defusage(code,msg=''):
172-
print(__doc__%globals(),file=sys.stderr)
173+
print(__doc__,file=sys.stderr)
173174
ifmsg:
174175
print(msg,file=sys.stderr)
175176
sys.exit(code)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp