1 |
This week I added a system to ventoo that highlights parts of a file |
2 |
when ventoo thinks they are invalid and should not be saved back into |
3 |
the file. The code that does the checking are external python scripts |
4 |
that users can easily add to ventoo without changing any other code. The |
5 |
reason this was added is that up until now as the user is editing a file |
6 |
he/she had no idea if the file was valid until a diff or a save was |
7 |
requested. Now SOME (or even most) errors can be caught with a python |
8 |
script that validates user input in the background. Even nicer is that |
9 |
well written scripts can catch errors that augeas can't. (augeas is the |
10 |
library I use to move the files in and out of memory and manipulate the |
11 |
file structure) For example, if the user enters /dev/sdf12, but that |
12 |
device doesn't exist, the cell lights up bright red. The user can still |
13 |
save, so it's really only a warning. Warnings like this can typically be |
14 |
checked in about 2-4 lines of python. Augeas already did a pretty good |
15 |
job of catching a lot of invalid config files, but this system makes it |
16 |
easier for the user and can catch errors that augeas wasn't designed to |
17 |
catch. |
18 |
|
19 |
Next week: |
20 |
Remote editing of other computers. |