source: TI12-security/trunk/python/ndg.security.common/ndg/security/common/utils/__init__.py @ 5165

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.common/ndg/security/common/utils/__init__.py@5165
Revision 5165, 619 bytes checked in by pjkersha, 11 years ago (diff)

More progress with condition functions for access control

Line 
1"""Utilities package for NDG Security
2
3NERC DataGrid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "02/04/09"
7__copyright__ = ""
8__license__ = "BSD - see LICENSE file in top-level directory"
9__contact__ = "Philip.Kershaw@stfc.ac.uk"
10__revision__ = '$Id: $'
11
12class UniqList(list):
13    """Extended version of list type to enable a list with unique items"""
14    def extend(self, iter):
15        super(UniqList, self).extend([i for i in iter if i not in self])
16       
17    def __iadd__(self, iter):
18        raise TypeError("+= operator not possible on UniqList. Try the extend "
19                        "method intead")
Note: See TracBrowser for help on using the repository browser.