diff --git a/tktermwidget/style.py b/tktermwidget/style.py index d916678..ab36d49 100644 --- a/tktermwidget/style.py +++ b/tktermwidget/style.py @@ -56,6 +56,15 @@ "foreground": "#efefef", } +# Check the style file +if not STYLE_PATH.exists(): + STYLE_PATH.mkdir(parents=True) + with open(JSON_FILE, "w", encoding="utf-8") as f: + dump("{}", f) +if not (JSON_FILE).exists(): + with open(JSON_FILE, "w", encoding="utf-8") as f: + dump("{}", f) + # Functions def write_style(**styles) -> None: @@ -271,6 +280,5 @@ def checkhexcolor(self, event: Event, name: str) -> None: CUSTOM: dict[str] = load_style() if __name__ == "__main__": - # An example or a test configstyle = Config(True, basedon=POWERSHELL) configstyle.mainloop()