Skip to content

Commit

Permalink
[fix] adding pyuseragents dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Animenosekai committed Apr 26, 2021
1 parent e953d46 commit d300725
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
setup(
name = "translatepy",
packages = ["translatepy"],
version = "1.6",
version = "1.6.1",
license = "GNU General Public License v3 (GPLv3)",
description = "Translate, transliterate, get the language of texts in no time with the help of multiple APIs!",
author = "Anime no Sekai",
author_email = "[email protected]",
url = "https://github.com/Animenosekai/translate",
download_url = "https://github.com/Animenosekai/translate/archive/v1.6.tar.gz",
download_url = "https://github.com/Animenosekai/translate/archive/v1.6.1.tar.gz",
keywords = ['python', 'translate', 'translation', 'google-translate', 'yandex-translate', 'bing-translate', 'reverso', 'transliteration', 'detect-language', 'text-to-speech'],
install_requires = ['safeIO>=1.2', 'requests', 'beautifulsoup4', 'typing; python_version<"3.5"'],
install_requires = ['safeIO>=1.2', 'requests', 'beautifulsoup4', 'typing; python_version<"3.5"', 'pyuseragents'],
classifiers = ['Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9'],
long_description = readme_description,
long_description_content_type = "text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion translatepy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__copyright__ = 'Copyright 2021, translate'
__credits__ = ['animenosekai']
__license__ = 'GNU General Public License v3 (GPLv3)'
__version__ = 'translatepy v1.6'
__version__ = 'translatepy v1.6.1'
__maintainer__ = 'Anime no Sekai'
__email__ = '[email protected]'
__status__ = 'Stable'
7 changes: 5 additions & 2 deletions translatepy/translate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
translatepy v1.6 (Stable)
translatepy v1.6.1 (Stable)
© Anime no Sekai — 2021
"""
Expand Down Expand Up @@ -193,7 +193,7 @@ def language(self, text) -> Union[Language, str, None]:
return None


def example(self, text, destination_language, source_language=None) -> Union[List, None]:
def example(self, text, destination_language=None, source_language=None) -> Union[List, None]:
"""
Returns a set of examples / use cases for the given word
Expand All @@ -204,6 +204,9 @@ def example(self, text, destination_language, source_language=None) -> Union[Lis
if str(text).replace(" ", "").replace("\n", "") == "":
return None

if destination_language is None:
destination_language = "Japanese" # could be anything

## language handling
if not isinstance(destination_language, Language):
destination_language = Language(destination_language)
Expand Down

0 comments on commit d300725

Please sign in to comment.