Changeset 2999 for WAeUP_SRP/base
- Timestamp:
- 8 Jan 2008, 19:10:04 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTool.py
r2975 r2999 62 62 return None 63 63 64 64 65 class WAeUPTool(UniqueObject, SimpleItem, ActionProviderBase): 65 66 """WAeUP tool""" … … 74 75 ) 75 76 77 security.declareProtected(View,'re_split') ###( 78 def re_split(self,split_string,string): 79 return re.split(split_string,string) 80 81 82 security.declareProtected(View,'difference') ###( 83 def difference(self,l1,l2): 84 return set(l1).difference(set(l2)) 85 76 86 def rwrite(self,s): ###( 77 87 response = self.REQUEST.RESPONSE … … 98 108 wf_def = getattr(self.portal_workflow,wf_definition) 99 109 wf_def.updateRoleMappingsFor(ob) 110 ###) 111 112 security.declareProtected(View,'getStatesLgas') ###( 113 def getStatesLgas(self): 114 """return lga info""" 115 voc = getattr(self.portal_vocabularies,'local_gov_areas') 116 states = [] 117 lgas = [] 118 d = {} 119 wd = {} 120 for k,v in voc.items(): 121 parts = v.split(' / ') 122 if len(parts) == 1: 123 state = parts[0].lower() 124 lga = "" 125 elif len(parts) == 2: 126 state = "_".join(re.split('[^a-zA-Z0-9/]',parts[0].lower())) 127 lga = "-".join(re.split('[^a-zA-Z0-9/]',parts[1].lower())) 128 else: 129 continue 130 if state not in states: 131 states.append(state) 132 if lga not in lgas: 133 lgas.append(lga) 134 words = re.split('[^a-zA-Z0-9/]',k) 135 words.sort() 136 wd[k] = words 137 d[k] = v 138 mapping = {} 139 mapping['word_dict'] = wd 140 mapping['lga_dict'] = d 141 mapping['states'] = states 142 mapping['lgas'] = lgas 143 return mapping 100 144 ###) 101 145
Note: See TracChangeset for help on using the changeset viewer.