From c8b952f400fc6949a2a29cbdbf27d4e3601931d6 Mon Sep 17 00:00:00 2001 From: Guillaume Blanchy <sagitta1618@gmail.com> Date: Mon, 21 Feb 2022 00:35:00 +0100 Subject: [PATCH] update small test --- Ohmpi.py | 13 +++++++------ dd.txt | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Ohmpi.py b/Ohmpi.py index 85f4f253..9fd2abd3 100644 --- a/Ohmpi.py +++ b/Ohmpi.py @@ -136,9 +136,9 @@ class OhmPi(object): if self.output == 'print': if level == 'error': - print(colored(level.upper() + ' : ' + msg), 'red') + print(colored(level.upper() + ' : ' + msg, 'red')) elif level == 'warn': - print(colored(level.upper() + ' : ' + msg), 'yellow') + print(colored(level.upper() + ' : ' + msg, 'yellow')) else: print(level.upper() + ' : ' + msg) elif self.output == 'mqtt': @@ -165,7 +165,8 @@ class OhmPi(object): if isinstance(config, dict): self.pardict.update(config) else: - dic = json.loads(config) + with open(config) as json_file: + dic = json.load(json_file) self.pardict.update(dic) self.dump('Acquisition parameters updated: ' + str(self.pardict), level='debug') @@ -589,8 +590,8 @@ class OhmPi(object): self.dump('status = ' + self.status) # test -#with open('ohmpi_param.json') as json_file: -# pardict = json.load(json_file) -ohmpi = OhmPi() +#ohmpi = OhmPi(config='ohmpi_param.json') #ohmpi.measure() +#time.sleep(4) +#ohmpi.stop() diff --git a/dd.txt b/dd.txt index c00dd97c..de98f644 100644 --- a/dd.txt +++ b/dd.txt @@ -1,5 +1,5 @@ 1 2 3 4 -1 3 5 7 +1 1 5 7 1 4 7 10 1 5 9 13 1 6 11 16 -- GitLab