fuego config file
Hi Tim,
I see that you have created a config_class with its own syntax and parsing tool. Was there any reason not to use ConfigParser?
Thanks,
Daniel
Quoted 9 lines
-----Original Message-----
From: Daniel Sangorrin
Hi Tim,I see that you have created a
config_classwith its own syntax and parsing tool.
Was there any reason not to use ConfigParser?
Yes, but not super strong ones ConfigParser doesn't allow values with leading or trailing whitespace (I believe). Also, I'm not a big fan of the syntax they user for multi-line values. I can't tell how strict it is preserving leading and trailing whitespace of continued lines, for multi-line values. Also I'm not sure I need to put stuff into sections. I don't know if ConfigParser requires that or not. I'm using triple-quotes for that (like python multi-line strings). I don't think my syntax is difficult, but I don't have strong reasons for it, and it might be easier for users if we used ConfigParser.
If you have strong feelings about it, I'm willing to change it. -- Tim
Quoted 12 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Tuesday, June 12, 2018 12:36 PM
To: [email protected]; [email protected]
Subject: RE: [Fuego] fuego config fileQuoted 4 lines
-----Original Message-----
From: Daniel Sangorrin
Hi Tim,
Quoted 7 lines
Quoted 3 lines
I see that you have created a
config_classwith its own syntax and parsing tool.
Was there any reason not to use ConfigParser?Yes, but not super strong ones ConfigParser doesn't allow values with leading or trailing
whitespace (I believe).
This is normal behaviour, isn't it?
Why would you want leading/trailing whitespace to be recognized as part of the variable? For example: Do you want that the following variables are different? host_name=fuego_host
host_name= fuego_host
I think that from the user point of view ignoring whitespace is the sane thing to do.
Quoted 5 lines
Also, I'm not a big fan of the syntax they user for multi-line
values.
I can't tell how strict it is preserving leading and trailing whitespace of continued lines,
for multi-line values.
Right, they are stripped and newlines appear. But do we actually need multi-line values?
Quoted 4 lines
Also I'm not sure I need to put stuff into sections. I don't
know if
ConfigParser requires that or not. I'm using triple-quotes for that (like python multi-line strings).
If we don't need sections (kind of namespaces) then we can just use a 'default' section. But I think sections are a nice thing to have.
Quoted 5 lines
I don't think my syntax is difficult, but I don't have strong reasons for it, and it might be easier
for users if we used ConfigParser.If you have strong feelings about it, I'm willing to change it.
I would like to change and use ConfigParser. Specially from the point of view of maintainability, and minimization of custom code. Using ConfigParser would make the code much easier to read. If you don't mind, I will modify this.
Also, I noticed that there was a dead function "do_set_config" but no related ftc subcommand. How about using the following interface?
$ ftc config -g var1,var2,var3 (-g|--get: get the values of one or more variables) var1=how var2=are var3=you $ ftc config -s "var1=am, var2=I" (-s|--set: set variables) $ ftc config -g (by default gets the values of all variables) var1=am var2=I var3=you
Thanks,
Daniel