-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migrate_cache() and remove deprecated funcs (#56)
* feat: add migrate_cache(); * refactor: remove deprecated functions; * fix: update workflow;
- Loading branch information
Showing
9 changed files
with
149 additions
and
205 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[path] | ||
data_home = .tsdb | ||
data_home = ~/.tsdb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
Config functions for TSDB. | ||
""" | ||
|
||
# Created by Wenjie Du <wenjay.du@gmail.com> | ||
# License: BSD-3-Clause | ||
|
||
import os | ||
from configparser import ConfigParser | ||
|
||
from .logging import logger | ||
|
||
TSDB_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) | ||
TSDB_CONFIG_FILE = os.path.join(TSDB_BASE_PATH, "config.ini") | ||
|
||
|
||
def read_configs(): | ||
config_parser = ConfigParser() | ||
config_parser.read(TSDB_CONFIG_FILE) | ||
return config_parser | ||
|
||
|
||
def write_configs(config_parser, key_value_set): | ||
for section in key_value_set.keys(): | ||
for key in key_value_set[section].keys(): | ||
value = key_value_set[section][key] | ||
config_parser.set(section, key, value) | ||
|
||
with open(TSDB_CONFIG_FILE, "w") as f: | ||
config_parser.write(f) | ||
|
||
logger.info("Wrote new configs to config.ini successfully.") |
Oops, something went wrong.