Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
littlewhitecloud authored Jul 12, 2023
1 parent 81f4568 commit 1c767e6
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions tktermwidget/__init__.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
"""__init__ of the tktermwidget package"""
from json import dump
from pathlib import Path

from platformdirs import user_cache_dir

from .style import * # noqa: F401, F403
from .widgets import Terminal # noqa: F401

# Get the package path
PACKAGE_PATH = Path(user_cache_dir("tktermwidget"))
# Get the history file
HISTORY_FILE = PACKAGE_PATH / "history.txt"
# Get the json file (style)
JSON_FILE = PACKAGE_PATH / "styles.json"

if not PACKAGE_PATH.exists(): # Check the "tktermwidget" is exsit
PACKAGE_PATH.mkdir(parents=True)
# Also create the history file
with open(HISTORY_FILE, "w", encoding="utf-8") as f:
f.close()
# Also create the json file
with open(JSON_FILE, "w", encoding="utf-8") as f:
dump("{}", f)

# Check that the history file exists
if not (HISTORY_FILE).exists():
with open(HISTORY_FILE, "w", encoding="utf-8") as f:
f.close()

# Check that the json file exists
if not (JSON_FILE).exists():
with open(JSON_FILE, "w", encoding="utf-8") as f:
dump("{}", f)
"""Tktermwidget package"""
from .style import * # noqa: F401
from .tkterm import Terminal # noqa: F401

0 comments on commit 1c767e6

Please sign in to comment.