[CMF-checkins] CVS: CMF/CMFCollector/skins/collector - collector_ordered_traits.py:1.1
Ken Manheimer
klm@zope.com
Thu, 25 Oct 2001 14:34:04 -0400
Update of /cvs-repository/CMF/CMFCollector/skins/collector
In directory cvs.zope.org:/tmp/cvs-serv22087/skins/collector
Added Files:
collector_ordered_traits.py
Log Message:
Helper used by collector_contents.pt
=== Added File CMF/CMFCollector/skins/collector/collector_ordered_traits.py ===
## Script (Python) "collector_ordered_traits.py"
##parameters=traits, order
##title=Return traits list ordered according to second arg, then remainder.
remainder = filter(None, traits[:])
got = []
for i in order:
if not remainder:
break
if i in remainder:
got.append(i)
remainder.remove(i)
return got + remainder