Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/fixate/core/config_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import copy
from shutil import copy2
from pathlib import Path
from cmd2.ansi import style, Fg
from fixate.drivers.pps.bk_178x import BK178X
from pyvisa.errors import VisaIOError
import fixate.config
from cmd2.string_utils import stylize
from cmd2.colors import Color

"""
fxconfig is a configuration utility that helps find connected instruments and add them to fixate's driver
Expand Down Expand Up @@ -66,8 +67,6 @@ class FxConfigError(Exception):


class FxConfigCmd(cmd2.Cmd):
prompt = "fx>"

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.config_file_path = None
Expand All @@ -78,6 +77,8 @@ def __init__(self, *args, **kwargs):
self.complete_save = self.path_complete
self.complete_open = self.path_complete

self.prompt = "fx>"

def postloop(self):
"""Print a new line so the shell prompt get printed on its own line after we exit"""
self.poutput("")
Expand Down Expand Up @@ -303,13 +304,13 @@ def _print_config_dict(self, config_dict):
self.poutput("SERIAL || " + com_port + " || " + str(parameters))

def _test_print_error(self, name, msg):
self.poutput(style("ERROR: ", fg=Fg.RED), end="")
self.poutput(style(str(name), fg=Fg.CYAN), end="")
self.poutput(stylize("ERROR: ", style=f"bold {Color.RED}"), end="")
self.poutput(stylize(str(name), style=Color.CYAN), end="")
self.poutput(f" - {msg}")

def _test_print_ok(self, name, msg):
self.poutput(style("OK: ", fg=Fg.GREEN), end="")
self.poutput(style(str(name), fg=Fg.CYAN), end="")
self.poutput(stylize("OK: ", style=f"bold {Color.GREEN}"), end="")
self.poutput(stylize(str(name), style=Color.CYAN), end="")
self.poutput(f" - {msg}")

def _test_config_dict(self, config_dict):
Expand Down
Loading