introduce general config file

+ redesign general config
+ remove obsolete secop/paths.py

Change-Id: Ice08ec37c54b1a6e2e2e6e29fdaaf0bd2dd725dc
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/27362
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2021-12-20 15:27:05 +01:00
parent c5d228ffc4
commit f13e29aad2
7 changed files with 96 additions and 82 deletions

View File

@@ -29,7 +29,7 @@ from secop.modules import Module
from secop.params import Parameter
from secop.properties import Property
from secop.protocol.interface.tcp import TCPServer
from secop.server import getGeneralConfig
from secop.server import generalConfig
uipath = path.dirname(__file__)
@@ -106,7 +106,7 @@ def get_file_paths(widget, open_file=True):
def get_modules():
modules = {}
base_path = getGeneralConfig()['basedir']
base_path = generalConfig.basedir
# pylint: disable=too-many-nested-blocks
for dirname in listdir(base_path):
if dirname.startswith('secop_'):
@@ -156,7 +156,7 @@ def get_interface_class_from_name(name):
def get_interfaces():
# TODO class must be found out like for modules
interfaces = []
interface_path = path.join(getGeneralConfig()['basedir'], 'secop',
interface_path = path.join(generalConfig.basedir, 'secop',
'protocol', 'interface')
for filename in listdir(interface_path):
if path.isfile(path.join(interface_path, filename)) and \