arsenal-devel team mailing list archive
-
arsenal-devel team
-
Mailing list archive
-
Message #00076
Re: Attachments filtering
I've posted my proposed filters code to this branch:
lp:~bryceharrington/arsenal/lpltk-filtered-attachments
Note this is totally untested and likely has typos and errors, but
wanted to get it up for discussion.
Let me know your thoughts. I'll plan on landing this in a couple days
after I've done some testing of it, unless anyone has any qualms that
should be addressed.
Bryce
On Tue, Jul 20, 2010 at 02:36:14PM -0700, Bryce Harrington wrote:
> I'm looking at Brad's new Attachment and Attachments class in
> python-launchpadlib-toolkit, and also looking at Kamran's new code in
> arsenal/scripts/send-attachments-upstream.py particularly the bits for
> doing file exclusions. I'm interested in seeing how to combine these
> two things.
>
> In other words, what's needed is a way to isolate a subset of the
> attachments. For instance, if we care only about files provided by the
> original bug reporter, or if we wish to exclude certain filenames.
>
> The implementation of send-attachments-upstream.py iterates through the
> attachments on the bug report, and builds up a data structure of files
> that pass the exclusion criteria.
>
> The Attachments class implementation really works as a wrapper around
> the Launchpad attachments_collection, providing operators for iterating,
> searching, getting, etc. the collection. So it's a very different
> architectural pattern.
>
> My initial thought on how to merge these two concepts is to allow for
> adding 'filters' to an Attachments object. Then, instead of using
> self.__attachments directly, the operators would use a
> self.__filtered_attachments object which is comprised by iterating over
> self.__attachments and excluding all attachments meeting the filter
> criteria.
>
> Does that sound sane to you guys? I'll try coding it up so there's
> something more concrete to discuss.
>
> Bryce
>
> _______________________________________________
> Mailing list: https://launchpad.net/~arsenal-devel
> Post to : arsenal-devel@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~arsenal-devel
> More help : https://help.launchpad.net/ListHelp
Follow ups
References