Add Stopgap handling of cfg files in cfg-editor

Basic parsing and writing of python config files.
Does not preserve comments, can't transform the
old format to the new one.

This is just so the executable that is delivered
actually does something with the new config files.

Change-Id: I4bb8310e1af7a05f90dd426dfa629080583aff66
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/30935
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Alexander Zaft
2023-04-21 11:05:16 +02:00
parent f491625dd1
commit 5283b06cb7
7 changed files with 136 additions and 12 deletions

View File

@@ -29,6 +29,9 @@ from os import path
# Add import path for inplace usage
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
import logging
from mlzlog import ColoredConsoleHandler
from frappy.gui.qt import QApplication
from frappy.gui.cfg_editor.mainwindow import MainWindow
@@ -38,7 +41,11 @@ def main(argv=None):
parser.add_argument('-f', '--file', help='Configuration file to open.')
args = parser.parse_args()
app = QApplication(argv)
window = MainWindow(args.file)
logger = logging.getLogger('gui')
console = ColoredConsoleHandler()
console.setLevel(logging.INFO)
logger.addHandler(console)
window = MainWindow(args.file, log=logger)
window.show()
return app.exec()