-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#46 - Basic startup project manager window
- Loading branch information
1 parent
cb90f2d
commit b3c2da3
Showing
11 changed files
with
366 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class RunContext(object): | ||
def __new__(cls): | ||
if not hasattr(cls, 'instance'): | ||
cls.instance = super(RunContext, cls).__new__(cls) | ||
self = cls.instance | ||
self.nlp = None | ||
self.thesaurus = None | ||
self.spellcheck_dictionary = None | ||
self.has_available_update = None | ||
return cls.instance | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import json | ||
import os | ||
import string | ||
|
||
from src.domain.config import Config | ||
from src.domain.project import Project | ||
|
||
|
||
class ProjectService: | ||
# FUNCTION THAT LOADS PROJECT FROM FILE | ||
@staticmethod | ||
def load(path: string): | ||
if os.path.exists(path): | ||
with open(path, 'r') as file: | ||
p = json.load(file) | ||
return Project(p) | ||
else: | ||
return None | ||
|
||
# FUNCTION THAT SAVES CONFIG TO FILE | ||
@staticmethod | ||
def save(p: Project, path: string): | ||
with open(path, 'w') as file: | ||
json.dump(p.to_dict(), file, indent=4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.