arsenal-devel team mailing list archive
-
arsenal-devel team
-
Mailing list archive
-
Message #00075
Attachments filtering
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
Follow ups