-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path__init__.py
More file actions
42 lines (36 loc) · 1.08 KB
/
__init__.py
File metadata and controls
42 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from transifex.native.django.management.commands.transifex import Command
def get_transifex_command():
"""Return an instance of the Transifex Django command
that works in all Django versions.
After Django 2.0+, attempting to run
`call_command(command, 'subcommand', option=value)`
with `option` not being defined on the main command results
to a TypeError, e.g. Unknown option(s) for transifex command: dry_run
This is solved by adding all possible options to the command's
`stealth_options` attribute.
"""
command = Command()
command.stealth_options = (
# Migrate
'files',
'path',
'text',
'save_policy',
'review_policy',
'mark_policy',
'verbose',
# Push
'extension',
'append_tags',
'with_tags_only',
'without_tags_only',
'dry_run',
'override_tags',
'override_occurrences',
'do_not_keep_translations',
'symlinks',
'force_source_update',
# Invalidate
'purge',
)
return command