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

Appearance settings

Commit 2fa3eca

Browse filesBrowse files
author
Sebastian Ramacher
committed
Provide customized init_catalog, updated_messages and extract_messages.
1 parent 93b8170 commit 2fa3eca
Copy full SHA for 2fa3eca

1 file changed

+37-1Lines changed: 37 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎setup.py‎

Copy file name to clipboardExpand all lines: setup.py
+37-1Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323

2424
try:
2525
from babel.messages.frontend import compile_catalog as _compile_catalog
26-
from babel.messages.frontend import extract_messages
26+
from babel.messages.frontend import extract_messages as _extract_messages
27+
from babel.messages.frontend import update_catalog as _update_catalog
28+
from babel.messages.frontend import init_catalog as _init_catalog
2729
using_translations = True
2830
except ImportError:
2931
using_translations = False
@@ -44,10 +46,44 @@ def initialize_options(self):
4446
self.directory = translations_dir
4547
self.use_fuzzy = True
4648

49+
class update_catalog(_update_catalog):
50+
def initialize_options(self):
51+
"""Simply set default domain and directory attributes to the
52+
correct path for bpython."""
53+
_update_catalog.initialize_options(self)
54+
55+
self.domain = 'bpython'
56+
self.output_dir = translations_dir
57+
self.input_file = os.path.join(translations_dir, 'bpython.pot')
58+
59+
class extract_messages(_extract_messages):
60+
def initialize_options(self):
61+
"""Simply set default domain and output file attributes to the
62+
correct values for bpython."""
63+
_extract_messages.initialize_options(self)
64+
65+
self.domain = 'bpython'
66+
self.output_file = os.path.join(translations_dir, 'bpython.pot')
67+
68+
class init_catalog(_init_catalog):
69+
def initialize_options(self):
70+
"""Simply set default domain, input file and output directory
71+
attributes to the correct values for bpython."""
72+
_init_catalog.initialize_options(self)
73+
74+
self.domain = 'bpython'
75+
self.output_dir = translations_dir
76+
self.input_file = os.path.join(translations_dir, 'bpython.pot')
77+
4778
build.sub_commands.append(('compile_catalog', None))
79+
build.sub_commands.append(('update_catalog', None))
80+
build.sub_commands.append(('extract_messages', None))
81+
build.sub_commands.append(('init_catalog', None))
4882

4983
cmdclass['compile_catalog'] = compile_catalog
5084
cmdclass['extract_messages'] = extract_messages
85+
cmdclass['update_catalog'] = update_catalog
86+
cmdclass['init_catalog'] = init_catalog
5187

5288

5389
if platform.system() in ['FreeBSD', 'OpenBSD']:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.