Skip to content

Commit

Permalink
.fixing vocabulary manager issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ghalter committed Nov 9, 2021
1 parent 17fc0e5 commit a6ae450
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deployment_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ jobs:
- name: Release
uses: ncipollo/release-action@v1
with:
bodyFile: "result.zip"
artifacts: "result.zip"
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/deployment_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ jobs:
- name: Release
uses: ncipollo/release-action@v1
with:
bodyFile: "vian/dist/VIAN"
artifacts: "vian/dist/VIAN"
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion vian/core/container/vocabulary_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ def save(self, filepath=None):
for i, t in self.collections.items():
data['collections'].append(t.serialize())

data = json.dumps(data)
with open(filepath, "w") as f:
json.dump(data, f)
f.write(data)

return data

Expand Down
6 changes: 5 additions & 1 deletion vian/core/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ def __init__(self, loading_screen:QSplashScreen, file = None):
self.onStartFlaskServer.emit()


self.vocabulary_library = VocabularyLibrary().load(os.path.join(self.settings.DIR_TEMPLATES, "library.json"))
try:
self.vocabulary_library = VocabularyLibrary().load(os.path.join(self.settings.DIR_TEMPLATES, "library.json"))
except Exception as e:
self.vocabulary_library = VocabularyLibrary()
self.vocabulary_library.save(os.path.join(self.settings.DIR_TEMPLATES, "library.json"))
self.vocabulary_library.onLibraryChanged.connect(self.on_vocabulary_library_changed)

self.web_view = FlaskWebWidget(self)
Expand Down

0 comments on commit a6ae450

Please sign in to comment.