11 from exceptions import MissingFile
14 def boot(config, to_database = True):
16 os.mkdir(sf(conf.output_folder))
17 except FileExistsError:
20 sprc = subprocess.Popen(conf.boot_command, stdout = subprocess.PIPE)
21 with open(os.path.join(sf(conf.output_folder), config.cfile), "a") as f:
22 for linen in sprc.stdout:
23 line = linen.decode('utf-8')
28 # Let user script parse double value
32 out = utils.callsubprocess('parse_command', conf.parse_command,
33 conf.parse_output, True)
35 except Exception as e:
36 print("W: parse exception: " + e.__str__())
39 dtb = database.database()
40 dtb.add_measure(config.cfile, config.id, value)