1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tools: pyterm: properly handle custom output fmt

This commit is contained in:
Oleg Hahm 2017-01-10 10:56:26 +01:00
parent 11a0422b83
commit 486ca73308

View File

@ -126,9 +126,10 @@ class SerCmd(cmd.Cmd):
self.json_regs = dict()
self.init_cmd = []
self.load_config()
self.fmt_str = None
if not self.fmt_str:
if self.fmt_str == None:
self.fmt_str = default_fmt_str
else:
self.fmt_str = str(self.fmt_str.replace('"', '')) + "%(message)s"
# check for a history file
try:
@ -459,7 +460,9 @@ class SerCmd(cmd.Cmd):
"""Internal function to laod configuration from file.
"""
self.config = configparser.SafeConfigParser()
self.config.read([self.configdir + os.path.sep + self.configfile])
cf = os.path.join(self.configdir, self.configfile)
self.config.read(cf)
logging.getLogger("").info("Reading file: %s" % cf)
for sec in self.config.sections():
if sec == "filters":