nidhal baccouri
commited on
Commit
·
5c85230
1
Parent(s):
d03a2fc
added engines dunder
Browse files- deep_translator/cli.py +2 -4
- deep_translator/engines.py +7 -0
deep_translator/cli.py
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
"""Console script for deep_translator."""
|
2 |
import argparse
|
3 |
-
from .
|
4 |
|
5 |
|
6 |
class CLI(object):
|
7 |
-
translators_dict =
|
8 |
-
translator.__name__.replace('Translator', '').lower():
|
9 |
-
translator for translator in BaseTranslator.__subclasses__()}
|
10 |
translator = None
|
11 |
|
12 |
def __init__(self, custom_args=None):
|
|
|
1 |
"""Console script for deep_translator."""
|
2 |
import argparse
|
3 |
+
from .engines import __engines__
|
4 |
|
5 |
|
6 |
class CLI(object):
|
7 |
+
translators_dict = __engines__
|
|
|
|
|
8 |
translator = None
|
9 |
|
10 |
def __init__(self, custom_args=None):
|
deep_translator/engines.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from .base import BaseTranslator
|
3 |
+
|
4 |
+
__engines__ = {
|
5 |
+
translator.__name__.replace('Translator', '').lower():
|
6 |
+
translator for translator in BaseTranslator.__subclasses__()
|
7 |
+
}
|