Martijn Pieters wrote:
On 7/17/07, whit [EMAIL PROTECTED] wrote:
Martijn Pieters wrote:
def chunks(self):
chunks = super(WickedFilter, self).chunks
# every 2nd entry is the parens group, so filter out by
# grabbing every 1st and 3rd
firsts = itertools.islice(chunks, 0, None, 3)
thirds = itertools.islice(chunks, 2, None, 3)
result = []
# then append every 1st and 3rd to a list
map(result.extend, itertools.izip(firsts, thirds))
any difference between this and:
for slice in itertools.izip(firsts, thirds):
result.extend(slice)
Nothing, the code grew a bit and wasn't finished. :) There is a if
len(chunks) = 1: return chunks missing there too, for example.
there may be a simpler juncture for getting the desired effect.
the filter is run by a subscriber, and running it twice (once for each
desired pattern) would be trivial, rather than pushing additional
complexity into the filtering classes. This would happen for both the
findall call that is part of the storing event and the split call that
is part of rendering.
Plone would use these special subscribers and if folks just wanted
either/or behavior, they could disable them and use the old subscribers.
I am not too familiar with the subscribers, but that sounds like a
fine plan to me.
subscribers handle all the action on render or on store. iirc, it's
just a matter of setting the pattern before each run of the filter and
clearing the memos.
I am assuming the current UI uses a radio select (format a *or* format
b). You could change this to a set of checkboxes. Replacing the
subscriber with one that runs either filter based on those selection
boxes would get you the same effect, no?
iirc, the whole point of this was so limi could have an interface where
one could turn on or off wiki linking(no other choices). I assume after
this is solved, thats' what will happen.
-w
--
-- d. whit morriss --
- senior engineer, opencore -
- http://www.openplans.org -
- m: 415-710-8975 -
If you don't know where you are,
you don't know anything at all
Dr. Edgar Spencer, Ph.D., 1995
begin:vcard
fn:D. Whitfield Morriss
n:Morriss;D. Whitfield
org:The Open Planning Project;OpenPlans
adr:;;1309 Ashwood Ave;Nashville;TN;37212;USA
email;internet:[EMAIL PROTECTED]
title:Lead Developer
tel;home:615 292-9142
tel;cell:415 710-8975
x-mozilla-html:FALSE
version:2.1
end:vcard
___
Framework-Team mailing list
Framework-Team@lists.plone.org
http://lists.plone.org/mailman/listinfo/framework-team