Update user agent to pass the tests
This commit is contained in:
parent
c40e9b720b
commit
4da5f2619f
@ -12,9 +12,10 @@ from future.moves.urllib.parse import quote
|
|||||||
from . import __version__
|
from . import __version__
|
||||||
from googletrans import urls
|
from googletrans import urls
|
||||||
from googletrans.conversion import format_json
|
from googletrans.conversion import format_json
|
||||||
|
from googletrans.conversion import LANGUAGES
|
||||||
from googletrans.response import Translated, Detected
|
from googletrans.response import Translated, Detected
|
||||||
|
|
||||||
user_agent = 'PyGt/{0}'.format(__version__)
|
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36 Gt/{0}'.format(__version__)
|
||||||
|
|
||||||
EXCLUDES = ['en', 'ca', 'fr']
|
EXCLUDES = ['en', 'ca', 'fr']
|
||||||
RE_SRC = re.compile(',\[\["([\w]{2})"\]')
|
RE_SRC = re.compile(',\[\["([\w]{2})"\]')
|
||||||
@ -165,3 +166,8 @@ Advanced usage:
|
|||||||
result = Detected(lang=src, confidence=confidence)
|
result = Detected(lang=src, confidence=confidence)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def get_languages():
|
||||||
|
return LANGUAGES
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user