Changeset 6157 for main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
- Timestamp:
- 20 May 2011, 08:52:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r6147 r6157 9 9 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm 10 10 11 12 11 class FatalCSVError(Exception): 13 12 """Some row could not be processed. … … 24 23 class RoleSource(BasicSourceFactory): 25 24 def getValues(self): 25 # late import: in interfaces we should not import local modules 26 from waeup.sirp.permissions import getWAeUPRoleNames 27 return getWAeUPRoleNames() 28 29 def getTitle(self, value): 30 # late import: in interfaces we should not import local modules 26 31 from waeup.sirp.permissions import getRoles 27 return getRoles() 28 def getTitle(self, value): 29 if isinstance(value, basestring): 30 return value.split('.', 2)[1] 32 roles = dict(getRoles()) 33 if value in roles.keys(): 34 title = roles[value].title 35 if '.' in title: 36 title = title.split('.', 2)[1] 37 return title 31 38 32 39 class IWAeUPObject(Interface):
Note: See TracChangeset for help on using the changeset viewer.