![]() |
Clean way to add/remove LED patterns to mce.ini
The idea is that I have an application and I would like to add a custom LED pattern, this means manipulating the mce.ini, adding first the pattern definition to correct section and then the pattern to the patterns to be loaded list.
I can do this in python via the ConfigParser module, but it will strip all comments when writing the modified file (which is kind of obvious and I was expecting it to happen), this is undesirable. There have been suggested patches to ConfigParser for "surgical" editing but nothing has come of them. Basically idea is to add a new mySuperCoolLedPattern at postinstall and remove it at postrm without messing up rest of the mce.ini. So I wonder what would be the cleanest way to do this (writing my own config file parser that supports only the very small subset of features required to do this? anyway there needs to be some extra logic since the LEDPatterns variable is not a proper dictionary but just semicolon separate values) |
Re: Clean way to add/remove LED patterns to mce.ini
Quote:
So unless someone has made such a tool already it seems I will have to write one. |
Re: Clean way to add/remove LED patterns to mce.ini
Quote:
I'll look at removing later (it requires a bit more sophistication to do it the way I would like to). |
Re: Clean way to add/remove LED patterns to mce.ini
|
Re: Clean way to add/remove LED patterns to mce.ini
There is a helper binary shipped with the LED pattern editor that can check patterns for correctness, overwrite mce.ini and restart mce. But it only supports changing existing patterns, not adding new ones (because the pattern editor doesn't need that). So the two tools have kind of orthogonal functionality.
|
Re: Clean way to add/remove LED patterns to mce.ini
u have to search forum better hehe
http://talk.maemo.org/showthread.php?t=46054 |
Re: Clean way to add/remove LED patterns to mce.ini
Quote:
The editor is a nice idea and I was thinking of something simple along the lines as well, need to check it out at some point (for example if it would allow copying the pattern to clipboard instead of overwriting mce.ini it would be a handy tool for generating patterns to be used with my tool later). edit: pattern format correctness check I was planning on adding as well. |
Re: Clean way to add/remove LED patterns to mce.ini
Removal seems to work cleanly now too, basically only pattern sanity-checking remains and then this tool is ready.
|
Re: Clean way to add/remove LED patterns to mce.ini
Ok, the package is in extras-devel, since it's meant mainly to be used by other programs it's in system not user/system section.
|
Re: Clean way to add/remove LED patterns to mce.ini
Quote:
|
All times are GMT. The time now is 11:20. |
vBulletin® Version 3.8.8