=
commited on
Commit
·
23ed530
1
Parent(s):
29bdf29
added absolute import
Browse files- deep_translator/__init__.py +3 -2
- deep_translator/google_trans.py +4 -4
- deep_translator/parent.py +2 -2
- deep_translator/pons.py +4 -5
deep_translator/__init__.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
"""Top-level package for deep_translator."""
|
2 |
-
from
|
3 |
-
from
|
|
|
4 |
# import exceptions
|
5 |
|
6 |
__author__ = """Nidhal Baccouri"""
|
|
|
1 |
"""Top-level package for deep_translator."""
|
2 |
+
from __future__ import absolute_import
|
3 |
+
from google_trans import GoogleTranslator
|
4 |
+
from pons import PonsTranslator
|
5 |
# import exceptions
|
6 |
|
7 |
__author__ = """Nidhal Baccouri"""
|
deep_translator/google_trans.py
CHANGED
@@ -1,8 +1,8 @@
|
|
|
|
1 |
from abc import ABC
|
2 |
-
|
3 |
-
from
|
4 |
-
from
|
5 |
-
from .parent import BaseTranslator
|
6 |
from bs4 import BeautifulSoup
|
7 |
import requests
|
8 |
|
|
|
1 |
+
from __future__ import absolute_import
|
2 |
from abc import ABC
|
3 |
+
from constants import BASE_URLS, GOOGLE_LANGUAGES_TO_CODES
|
4 |
+
from exceptions import LanguageNotSupportedException, ElementNotFoundInGetRequest, NotValidPayload, NotValidLength
|
5 |
+
from parent import BaseTranslator
|
|
|
6 |
from bs4 import BeautifulSoup
|
7 |
import requests
|
8 |
|
deep_translator/parent.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
"""Main module."""
|
2 |
-
|
3 |
-
from
|
4 |
from abc import ABC, abstractmethod
|
5 |
|
6 |
|
|
|
1 |
"""Main module."""
|
2 |
+
from __future__ import absolute_import
|
3 |
+
from exceptions import NotValidPayload
|
4 |
from abc import ABC, abstractmethod
|
5 |
|
6 |
|
deep_translator/pons.py
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
-
from
|
2 |
-
|
3 |
from bs4 import BeautifulSoup
|
4 |
import requests
|
5 |
-
from
|
6 |
-
from
|
7 |
-
from
|
8 |
from requests.utils import quote
|
9 |
|
10 |
|
|
|
1 |
+
from __future__ import absolute_import
|
|
|
2 |
from bs4 import BeautifulSoup
|
3 |
import requests
|
4 |
+
from constants import BASE_URLS, PONS_LANGUAGES_TO_CODES, PONS_CODES_TO_LANGUAGES
|
5 |
+
from exceptions import LanguageNotSupportedException, ElementNotFoundInGetRequest
|
6 |
+
from parent import BaseTranslator
|
7 |
from requests.utils import quote
|
8 |
|
9 |
|