Changeset 7871 for main/waeup.kofa/trunk/src
- Timestamp:
- 13 Mar 2012, 09:15:00 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r7851 r7871 210 210 APP_CATS_DICT = Attribute("Dict of application categories") 211 211 SEMESTER_DICT = Attribute("Dict of semesters or trimesters") 212 INT_PHONE_PREFIXES = Attribute("Dict of international phone number prefixes") 212 213 213 214 def sendContactForm( -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r7843 r7871 56 56 'ig':(6, u'Igbo'), 57 57 } 58 59 INT_PHONE_PREFIXES = { 60 _('Germany'): (2, '49'), 61 _('Nigeria'): (1, '234'), 62 _('U.S.'): (3, '1'), 63 } 58 64 59 65 EXAM_SUBJECTS_DICT = { -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/phonewidget.py
r7870 r7871 32 32 """ 33 33 34 INT_PHONE_PREFIXES = {35 _('Germany'): (2, '49'),36 _('Nigeria'): (1, '234'),37 _('U.S.'): (3, '1'),38 }39 40 34 class PhonePrefixes(grok.GlobalUtility): 41 35 grok.implements(IInternationalPhonePrefixes) 42 36 43 _data = sorted(INT_PHONE_PREFIXES.items(), key=lambda value: value[1][0])44 45 37 def title_value_list(self): 46 return [('%s (+%s)' % (x,y[1]), '+%s' % y[1]) for x,y in self._data] 38 try: 39 from waeup.kofa.interfaces import IKofaUtils 40 prefixes = getUtility(IKofaUtils).INT_PHONE_PREFIXES 41 data = sorted(prefixes.items(), key=lambda value: value[1][0]) 42 except: 43 data = [('Country of Nowhere',(1, '234'))] 44 return [('%s (+%s)' % (x,y[1]), '+%s' % y[1]) for x,y in data] 47 45 48 46 RE_INT_PREFIX = re.compile('^\+\d+')
Note: See TracChangeset for help on using the changeset viewer.