Commit 1c5e7df2 authored by magho's avatar magho

fixed config file path

parent 8ec87245
......@@ -24,17 +24,18 @@ class NeoKomp(QtWidgets.QMainWindow):
self.parent = parent
if config_path != None:
config_file_path = "%s/" % config_path
config_file_path = "%s" % config_path
else:
config_file_path = ""
config_file_path = "."
self.config_path = config_file_path
# Read in parameters
with open ("%sapikey.key" % config_file_path, "r") as myfile:
with open ("%s/apikey.key" % config_file_path, "r") as myfile:
self.API_key = myfile.readline().rstrip("\n\r")
# Read in device <-> seksjon mapping as a dict
# device_mapping.txt must contain lines with <BLE Address> <Seksjon>
with open('%sdevice_mapping.txt' % config_file_path) as f:
with open('%s/device_mapping.txt' % config_file_path) as f:
self.device_mapping = dict(x.rstrip().split(None, 1) for x in f)
# Window Title
......
......@@ -24,7 +24,7 @@ class GenericFrame(QtWidgets.QWidget):
self.title_bar.addStretch()
self.banner = QtSvg.QSvgWidget('./omegav_text.svg')
self.banner = QtSvg.QSvgWidget('%s/omegav_text.svg' % self.parent.config_path)
banner_height = 30
self.banner.setMaximumHeight(banner_height)
self.banner.setMaximumWidth(banner_height*7.7788)
......
......@@ -6,8 +6,8 @@ class Guide(GenericFrame):
The Guide frame displays instructional text on how to use the store
"""
def __init__(self, **kwargs):
super(Guide, self).__init__(**kwargs)
self.parent = kwargs['parent']
super(Guide, self).__init__(**kwargs)
self.init_layout()
......@@ -20,7 +20,7 @@ class Guide(GenericFrame):
# OV Logo Layout
self.logo_layout = QtWidgets.QHBoxLayout()
self.logo_svg = QtSvg.QSvgWidget('./omegav_logo.svg')
self.logo_svg = QtSvg.QSvgWidget('%s/omegav_logo.svg' % self.parent.config_path)
self.logo_svg.setMaximumHeight(400)
self.logo_svg.setMaximumWidth(400)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment