-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save settings outside the hw folder. (#137)
- Loading branch information
1 parent
d04f807
commit 422068f
Showing
3 changed files
with
32 additions
and
12 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
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,17 @@ | ||
import json | ||
import os | ||
from pathlib import Path | ||
|
||
home = str(Path.home()) | ||
config_path = home + "/.scheme_editor" | ||
|
||
|
||
def save_config(key, content): | ||
os.makedirs(config_path, exist_ok=True) | ||
with open(config_path + "/" + key + ".config", "w+") as f: | ||
f.write(json.dumps(content)) | ||
|
||
|
||
def load_config(key): | ||
with open(config_path + "/" + key + ".config", "r") as f: | ||
return json.loads(f.read()) |
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