Changeset 1126 for ZMS/trunk/_zcatalogmanager.py
- Timestamp:
- 28.07.2010 22:00:49 (22 months ago)
- File:
-
- 1 edited
-
ZMS/trunk/_zcatalogmanager.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ZMS/trunk/_zcatalogmanager.py
r1124 r1126 66 66 elif type(v) is list: 67 67 for i in v: 68 s += search_string(i) 68 s += search_string(i) + ' ' 69 69 elif type(v) is dict: 70 70 for k in v.keys(): 71 71 i = v[k] 72 s += search_string(i) 72 s += search_string(i) + ' ' 73 73 return s 74 74 … … 122 122 pass 123 123 124 125 124 # -------------------------------------------------------------------------- 126 125 # _zcatalogmanager.getCatalog: … … 199 198 # -------------------------------------------------------------------------- 200 199 def search_encode(self, s): 201 try: 202 s = unicode( s, 'utf-8').encode( 'latin-1') 203 # German Umlauts in capital letters. 204 mapping = { 205 '\xc4':'\xe4', # Ae 206 '\xd6':'\xf6', # Oe 207 '\xdc':'\xfc', # Ue 208 } 209 for capital in mapping.keys(): 210 letter = mapping[ capital] 211 while s.find( capital) >= 0: 212 s = s.replace( capital, letter) 213 except ( UnicodeDecodeError, UnicodeEncodeError): 214 _globals.writeError(self,"[search_encode]") 215 try: 216 v = str(sys.exc_value) 217 STR_POSITION = ' position ' 218 i = v.find(STR_POSITION) 219 if i > 0: 220 v = v[i+len(STR_POSITION):] 221 if v.find('-') > 0: 222 l = int( v[:v.find('-')]) 223 h = int( v[v.find('-')+1:v.find(':')]) 224 else: 225 l = int( v[:v.find(':')]) 226 h = l 227 ln = max( l - 20, 0) 228 hn = min( h + 20, len(s)) 229 print ">>>>>",s[ln:hn] 230 print ">>>>>"," "*(l-ln)+"^"*(h-l+1) 231 except: 232 _globals.writeError(self,"[search_encode]: ignore exception") 233 return s 200 return _globals.umlaut_quote(s) 234 201 235 202
Note: See TracChangeset
for help on using the changeset viewer.
