Skip to content

Commit

Permalink
Fixed CLI after last changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroallenrevez committed Jan 12, 2022
1 parent 824c397 commit b80bff4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jisho_api/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def scrape_tokens(file_path: str):
def request_word(word: str, cache: bool, no_cache: bool):
"""Uses jisho.org word search API.
"""
from jisho_api.word.request import Word
flag = (cache or _cache_enabled()) and not no_cache
w = Word.request(word, cache=flag)
if w:
Expand All @@ -155,6 +156,7 @@ def request_word(word: str, cache: bool, no_cache: bool):
def request_kanji(kanji: str, cache: bool, no_cache: bool):
"""Uses #kanji filter on jisho.org search engine.
"""
from jisho_api.kanji.request import Kanji
flag = (cache or _cache_enabled()) and not no_cache
k = Kanji.request(kanji, cache=flag)
if k:
Expand All @@ -168,6 +170,7 @@ def request_kanji(kanji: str, cache: bool, no_cache: bool):
def request_sentence(sentence: str, cache: bool, no_cache: bool):
"""Uses #sentences filter on jisho.org search engine.
"""
from jisho_api.sentence.request import Sentence
flag = (cache or _cache_enabled()) and not no_cache
k = Sentence.request(sentence, cache=flag)
if k:
Expand All @@ -180,6 +183,7 @@ def request_sentence(sentence: str, cache: bool, no_cache: bool):
def request_tokens(sentence: str, cache: bool, no_cache: bool):
"""jisho.org default search engine tokenizer.
"""
from jisho_api.tokenize.request import Tokens
flag = (cache or _cache_enabled()) and not no_cache
k = Tokens.request(sentence, cache=flag)
if k:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "jisho_api"
version = "0.1.7"
version = "0.1.8"
description = "A jisho.org API and scraper in Python."
license = "Apache-2.0"
readme = "README.md"
Expand Down

0 comments on commit b80bff4

Please sign in to comment.