<div dir="ltr">Hello,<br><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 7, 2013 at 5:54 AM, Christian Boltz <span dir="ltr"><<a href="mailto:apparmor@cboltz.de" target="_blank">apparmor@cboltz.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
Am Freitag, 7. Juni 2013 schrieb Kshitij Gupta:<br>
<div class="im">> @John as suggested I used the configparser module and as it turns out<br>
> we do have a problem with using it. Actually in the config files at<br>
> present the default section is represented by an empty string (for<br>
> e.g. in /etc/apparmor/easyprof.conf ), but configparser needs a none<br>
> empty section header and hence raises an Error for the same.<br>
<br>
</div>We have several styles of config files:<br>
a) INI-like files (logprof.conf) - configparser can handle them<br>
b) shell-style config files (easyprof.conf, notify.conf, subdomain.conf)<br>
   with parameter=value or parameter="value" lines<br>
c) XML (reports.conf, which isn't used anymore)<br>
d) a CSV-line style + comments (severity.db, separated by whitespace)<br>
e) a mix of "parameter" and "parameter=value" (parser.conf)<br>
<br>
Yes, this is what you call "historically grown" :-(<br>
<br>
The good thing is that we don't have any files which mix those styles in<br>
one file.<br>
<br>
This means you _can_ use configparser - but it will only cover part a)<br>
(logprof.conf).<br>
<br>
If you need to parse the shell-style files from b), shlex might be an<br>
option, see <a href="http://docs.python.org/2/library/shlex.html" target="_blank">http://docs.python.org/2/library/shlex.html</a><br>
(I never tested it, but the description looks good ;-)<br>
<br>
c) is not relevant (the reporting code isn't maintained since a long<br>
time and isn't working anymore because of a changed log format - parts<br>
of it are replaced by aa-notify) - actually we should just delete<br>
reports.conf ;-)<br>
<br>
For d) severity.db, you really might need to write your own parser.<br>
(Shouldn't be too hard, and read-only is enough IMHO.)<br>
<br>
e) parser.conf might also need custom code, but I doubt you'll need to<br>
read it.<br>
<br>
To sum it up: Yes, you'll need to write code to parse some of the config<br>
files - but if there's an existing module (like logparser) to handle a<br>
file, I'd strongly recommend to use it.<br>
<div class="im"><br></div></blockquote><div>Okay, so the idea is that depending on which file is being read we use the specified parser (configprofiler/shlex/or any other). For writing to the config files the same can be done, though we will loose all and any comments in the config files.<br>
I'll work on separate parsers for each of those, I am going through the shlex library too. I'll let you know what I come up with.<br></div><div>BTW, thats even more reason to have wrappers for the read and write functions. ;-)<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
> Also, the order in which the config parser writes to output file is<br>
> random (expected of a dictionary) and not sorted.<br>
<br>
</div>This doesn't really matter. The more interesting questions are:<br>
- is the order really random? Or is it the order in which you added the<br>
  options?<br>
- does it keep the order if you modify a config file?<br>
- does it keep comments and empty lines?<br>
<div class="im"><br></div></blockquote><div>Well the configparser by default has ordered dicts and keeps the entries in the order they were read/added.<br></div><div>No, it simply ignores the comments and empty lines and creates a dictionary structure to display.<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
<br>
> On Fri, Jun 7, 2013 at 12:17 AM, Kshitij Gupta wrote:<br>
> > I've setup the wiki page for the project [<br>
> > <a href="http://wiki.apparmor.net/index.php/Profile_Management_Tools" target="_blank">http://wiki.apparmor.net/index.php/Profile_Management_Tools</a>], it'd<br>
> > be<br>
> > nice if some-one could just scroll through the page. I'll update the<br>
> > blog link once, I have an initial post ready for the project.<br>
> ><br>
> > @Christian please add your profile link with your name and maybe<br>
> > your IRC nick too.<br>
<br>
</div>It's on my TODO list, but not one of the most urgent things ;-)<br>
<div> <br></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
> > @John , @Christian also you can fill out the schedule for weekly<br>
> > meetings.<br>
<br>
</div>See below for a proposal.<br>
<div class="im"><br>
> > On Thu, Jun 6, 2013 at 12:54 AM, Kshitij Gupta wrote:<br>
> >> On Thu, Jun 6, 2013 at 12:12 AM, Christian Boltz wrote:<br>
> >>> Am Mittwoch, 5. Juni 2013 schrieb Kshitij Gupta:<br>
> >>> > @Christian First off, what mail client do you use? I'd like to<br>
> >>> > be able to have my replies like you all do.<br>
> >>><br>
> >>> Nearly every mail client supports this style to reply (even<br>
> >>> Outlook ;-) The main "trick" is to insert your reply in the<br>
> >>> middle of the quoted mail instead of typing at the first line.<br>
<br>
</div><div class="im">> >>> Ahh, that trick's pretty neat. I'm on GNOME though I have the<br>
> >>> KMail app.>><br>
> >> I'll give it a shot. :-) Meanwhile, lets see if the "trick" works<br>
> >> on Gmail. ;-)<br>
<br>
</div>It works, but you have to make sure to write your text in an empty line,<br>
not in a line starting with ">".<br>
<br>
Another thing you should do is deleting old text you don't need anymore.<br>
(If someone really wants to read the full discussion, he/she can easily<br>
read the older mails.)<br>
<div class="im"><br>
> >>> meetings at 20:00 UTC, but 18:30 or 19:00 UTC would also be<br>
> >>> possible for me. Would that work better for you?<br>
> >>> @John: what about you?<br>
> >>><br>
> >>> For our weekly meetings, I'm perfectly okay with anything around<br>
> >>> 19:00>><br>
<br>
</div>Sounds good. So I'd say:<br>
- weekly meetings every tuesday 19:00 UTC<br>
- if there is a monthly meeting scheduled, we merge in the weekly<br>
  meeting (and still start at 20:00 UTC)<br>
<div class="im"><br></div></blockquote><div>Sounds perfect to me. :-) <br></div><div>Shall we finalise it?<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">
> >> since I dont expect the discussions to last over 2-3 hours, which<br>
<br>
</div>correct - I'd expect something between 15 minutes and an hour<br>
<div> </div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
> >> isnt that late given my routine.<br>
<br>
</div>Sounds like you are a "night owl" ;-)  (is this term also used in<br>
India?)<br>
<br>
(Needless to say that it's 2:25 AM here...)<br>
<br></blockquote><div>Yes, it is and most of the grown-ups call us that (or plain "owl" ), though we prefer to call ourselves "nocturnal". ;-) <br></div><br></div><div class="gmail_quote">Regards,<br>
<br></div><div class="gmail_quote">Kshitij Gupta<br><br>-- <br><b>Bug 27162</b> -<span id="summary_alias_container"> 
      <span id="short_desc_nonedit_display">Wine developers prefer beer</span>
     </span><br></div><div class="gmail_quote">[cblotz at <a href="http://bugs.winehq.org/show_bug.cgi?id=27162">http://bugs.winehq.org/show_bug.cgi?id=27162</a>]<br></div><div class="gmail_quote">-- <br></div></div></div>
</div>