Skip to content
Snippets Groups Projects

Implement dialog to add/edit a single channel in database

Merged Lan Dam requested to merge i69-add-edit-single-channel-dialog into master
6 files
+ 88
55
Compare changes
  • Side-by-side
  • Inline
Files
6
import re
import os
from pathlib import Path
from sohstationviewer.conf.constants import (WF_1ST, WF_2ND, WF_3RD)
"""
@@ -42,3 +44,20 @@ dbConf = {
"If D is not defined, dots won't be displayed.\n"
"If L is not defined, lines will be plotted with color G")}
}
def modify_db_path():
"""
Modify dbpath to absolute path.
This function is called in case database needs to be used when the working
directory is a sub folder of root, sohstationviewer/. The following lines
need to be added:
from sohstationviewer.conf.dbSettings import modify_db_path
modify_db_path()
"""
global dbConf
current_file_path = os.path.abspath(__file__)
root = Path(current_file_path).parent.parent
db_path = [x for x in root.glob('**/soh.db')][0]
dbConf['dbpath'] = db_path.as_posix()
Loading