diff --git a/README.md b/README.md index 12a99af..dbebe70 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,9 @@ You may also want join our developer chat on Telegram at ## Change Log +### [0.9.1] - 2020-01-05 +- Fix issue with APP_DIR creation + ### [0.9.0] - 2020-01-05 - Add experimental support for Video-ID - Add special handling of YouTube URLs @@ -205,7 +208,6 @@ You may also want join our developer chat on Telegram at - Add support for Python 3.8 - Remove support for Python 3.5 - ### [0.8.2] - 2019-12-22 - Add new `test` command for confromance testing - Add support for .md (Markdown) files diff --git a/iscc_cli/__init__.py b/iscc_cli/__init__.py index e362b48..faffee4 100644 --- a/iscc_cli/__init__.py +++ b/iscc_cli/__init__.py @@ -2,9 +2,10 @@ import os import click -__version__ = "0.9.0" +__version__ = "0.9.1" APP_NAME = "iscc-cli" APP_DIR = click.get_app_dir(APP_NAME, roaming=False) +os.makedirs(iscc_cli.APP_DIR, exist_ok=True) os.environ["TIKA_PATH"] = APP_DIR diff --git a/iscc_cli/utils.py b/iscc_cli/utils.py index 86e5671..7ff0073 100644 --- a/iscc_cli/utils.py +++ b/iscc_cli/utils.py @@ -156,7 +156,6 @@ def download_file(url, md5=None, sanitize=False): md5_calc = hashlib.md5(open(out_path, "rb").read()).hexdigest() assert md5 == md5_calc return out_path - os.makedirs(iscc_cli.APP_DIR, exist_ok=True) r = requests.get(url, stream=True) length = int(r.headers["content-length"]) chunk_size = 512 diff --git a/poetry.lock b/poetry.lock index d26ee38..e115e08 100644 --- a/poetry.lock +++ b/poetry.lock @@ -396,7 +396,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] testing = ["pathlib2", "contextlib2", "unittest2"] [metadata] -content-hash = "dc9a5d3a7ab9a66df4fbc5e5088d0f617cc7a97341ac42aac5080735c8fd7afe" +content-hash = "90ea6e187f8d88079f50424575275f6ba0979305d7d4afc73518da3e9c09a05b" python-versions = "^3.6" [metadata.files] diff --git a/pyproject.toml b/pyproject.toml index d3ffd2d..ebdb7dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "iscc-cli" -version = "0.9.0" +version = "0.9.1" description = "ISCC CLI - Creates ISCC Codes from Media Files" authors = ["Titusz Pan "] license = "MIT" @@ -37,10 +37,10 @@ click = "^7.0" iscc = "1.0.5" tika = "1.23" click-default-group = "^1.2" -colorama = "^0.4.1" -imageio-ffmpeg = "^0.3.0" -lxml = "^4.4.2" -pytube = "^9.5.3" +colorama = "^0.4" +imageio-ffmpeg = "^0.3" +lxml = "^4.4" +pytube = "^9.5" [tool.poetry.dev-dependencies] pytest = "^5.0" diff --git a/tests/test_gen.py b/tests/test_gen.py index 8ad20f3..892159d 100644 --- a/tests/test_gen.py +++ b/tests/test_gen.py @@ -21,20 +21,20 @@ def test_gen_single_file(): def test_gen_single_guess(): - result = r.invoke(cli, ["gen", "tests/text/demo.txt"]) + result = r.invoke(cli, ["gen", "tests/text/demo.doc"]) assert result.exit_code == 0 - assert "ISCC:CTMjk4o5H96BV-CDcDwBFVJ54fe-CR7LRzaAJGwqX" in result.output - result = r.invoke(cli, ["gen", "-g", "tests/text/demo.txt"]) + assert "ISCC:CCKzUpp6U5hU7-CTMjk4o5H96BV-CDM6E14HcCZjQ-CR1LUvGDVrWye" in result.output + result = r.invoke(cli, ["gen", "-g", "tests/text/demo.doc"]) assert result.exit_code == 0 assert ( - "ISCC:CCFZWbGjth3qz-CTMjk4o5H96BV-CDcDwBFVJ54fe-CR7LRzaAJGwqX" in result.output + "ISCC:CCKzUpp6U5hU7-CTMjk4o5H96BV-CDM6E14HcCZjQ-CR1LUvGDVrWye" in result.output ) def test_gen_python_call(): from iscc_cli.gen import gen - file = open("tests/text/demo.txt") + file = open("tests/text/demo.doc") result = gen.callback(file, True, "", "", True) - assert result["iscc"] == "CCFZWbGjth3qz-CTMjk4o5H96BV-CDcDwBFVJ54fe-CR7LRzaAJGwqX" - assert result["norm_title"] == "iscc test document" + assert result["iscc"] == "CCKzUpp6U5hU7-CTMjk4o5H96BV-CDM6E14HcCZjQ-CR1LUvGDVrWye" + assert result["norm_title"] == "demo doc title from metadata"