From b7bb77db330580fd62ac50c865fd32c69416b10d Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 6 Jul 2020 10:21:35 +0300 Subject: [PATCH] 0.2.1 - some bugs fixed ### Fixed (#4) - Encoding issue occuring during installations on some systems - 'Invalid or unexistent files' error when importing json files --- CHANGELOG.md | 5 +++++ backend/handlers/NLUHandler.py | 4 ++-- gui/run.py | 4 ++-- setup.py | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21cd10c..b5c02d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.1] - 2020-07-06 +### Fixed +- Encoding issue occuring during installations on some systems +- 'Invalid or unexistent files' error when importing json files + ## [0.2.0] - 2020-07-01 ### Changed - Logic of PySimpleGui UI is split from processing data diff --git a/backend/handlers/NLUHandler.py b/backend/handlers/NLUHandler.py index c698016..b494a2d 100644 --- a/backend/handlers/NLUHandler.py +++ b/backend/handlers/NLUHandler.py @@ -32,8 +32,8 @@ def import_data(self): lambda node: node.name == example["intent"], maxlevel=2, ) - IntentExample(name=example["text"], parent=current_intent) - self.add_to_items(example["text"]) + IntentExample(name=example["example"], parent=current_intent) + self.add_to_items(example["example"]) except json.JSONDecodeError: # suggest it's markdown with open(self.filename, "r", encoding="utf-8") as df: diff --git a/gui/run.py b/gui/run.py index 71bfada..4429e98 100644 --- a/gui/run.py +++ b/gui/run.py @@ -38,7 +38,7 @@ def launcher(): stories = StoriesHandler(values[STORIES_FILE_KEY], nlu, resp) stories.import_data() - except (FileNotFoundError, KeyError): + except (FileNotFoundError, KeyError, AttributeError): sg.Popup( MSG_INVALID_OR_UNEXISTING_FILE, icon=sg.SYSTEM_TRAY_MESSAGE_ICON_WARNING, @@ -50,7 +50,7 @@ def launcher(): break import_window.close() - if nlu: # and resp and stories: + if nlu and resp and stories: nlu_tree = ExtendedTree( data=nlu.export_to_pysg_tree(), headings=[], diff --git a/setup.py b/setup.py index b8d4c28..8f6ce1d 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,11 @@ from setuptools import setup, find_packages -with open("README.md", "r") as f: +with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() setup( name="rasa-storyteller", - version="0.2", + version="0.2.1", author="ezhvsalate", author_email="ezhvsalate@ya.ru", description="A simple GUI utility to create complex stories for RASA chatbots easily.",