> Therefore, it was put forward, to include exclusions
> >as numbered keys,
> >using the existing method of an exclusion list entry. For example:
> >exclusion_item1=0:-:.*\.mp3$
> >exclusion_item2=0:-:http://.*www.x10.com/.*
> >The parser would then loop through a section, looking to see if there was
> >the next incremented
> >number of key, and if so, add that exclusion to the active exclusions.
>
> This raises an issue of interfaces. Certainly we could move exclusions to
> Plucker.INI, but for much of my parser testing (like when I was adding
> --stayondomain) I ran Plucker from the command line without a corresponding
> INI channel. Doing that, I can load exclusion lists from the
> command-line. So I certainly wouldn't want to completely deprecate
> exclusion files.
Absolutely. Would always continue the existing support for dedicated exclusion lists,
for both
compatibility and because it is helpful.
> On the other hand, I also agree that all channel-specific configuration
> data should go in a single place, and the INI file is a good contender for
> that.
>
> But either way, that's not in the Parser nor would Desktop see them or save
> exclusions there itself, so there's not much point in doing it in PlkrData
> right now. The exclusion list has GOT to wind up in a file on the other
> side. So packaging it as an encoded blob is probably faster than
> enumerating through a series of keys.
Probably a exclusion INI entry would have easier maintainabilty vis-a-vis a blob of
binary
data.
Yes, there would be a few lines added to the Python parser in the ExclusionList.py
file to add
the entries to the exclusions. The Desktop would read/write to the INI instead of a
exclusionlist for that channel.
As a general strategy, one could define:
parse_exclusion_entry(self,line)
m = re.match (r"([-+]?\d+):([-+]):(.*)", line)
if not m:
error ("ExclusionList: Cannot parse line: %s\n" % orig_line)
else:
prio = int (m.group (1))
action = m.group (2) == '+'
regexp = m.group (3)
new_item = (action, regexp)
if self._items.has_key (prio):
self._items[prio].append (new_item)
else:
self._items[prio] = [new_item]
by taking the above out of the load_file, calling it parse_exclusion_entry(), and then
write a
new entry that loops the keynames from the config. So it would be
def load_file(self,filename)
...(existing loop of number of lines in file)
line = (the existing strip of the /n)
parse_exclusion_entry(line)
def load_exclusion_entries_from_ini(self)
<loop increase name of key>
line = read ini to get line
parse_exclusion_entry(line)
Best wishes,
Robert
_______________________________________________
plucker-dev mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev