Changeset 1039
- Timestamp:
- 31.05.2010 22:02:19 (20 months ago)
- File:
-
- 1 edited
-
ZMS/trunk/ZMSGlobals.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ZMS/trunk/ZMSGlobals.py
r1034 r1039 1027 1027 except: 1028 1028 pass 1029 elif type(i) is str: 1030 return '\'%s\''%(str(i).replace('\'','\\\'')) 1031 elif i is not None: 1029 elif type(i) is int or type(i) is float: 1032 1030 return str(i) 1031 else: 1032 return '\'%s\''%(str(i).replace('\'','\\\'').replace('\n','\\n').replace('\r','\\r')) 1033 1033 return '\'\'' 1034 1034 … … 1037 1037 # -------------------------------------------------------------------------- 1038 1038 def str_item(self, i): 1039 if type(i) is list :1040 return ' '.join(map(lambda x: self.str_item(x)+'\n',i))1039 if type(i) is list or type(i) is tuple: 1040 return '\n'.join(map(lambda x: self.str_item(x),i)) 1041 1041 elif type(i) is dict: 1042 return ' '.join(map(lambda x: self.str_item(i[x])+'\n',i.keys()))1043 elif type(i) is t uple or type(i) is time.struct_time:1042 return '\n'.join(map(lambda x: self.str_item(i[x]),i.keys())) 1043 elif type(i) is time.struct_time: 1044 1044 try: 1045 i =self.getLangFmtDate(i)1045 return self.getLangFmtDate(i) 1046 1046 except: 1047 1047 pass 1048 elif i is not None:1048 if i is not None: 1049 1049 return str(i) 1050 1050 else: … … 1356 1356 except: 1357 1357 pass 1358 _globals.writeBlock( self, '[localfs_read]: filename=%s'%filename) 1358 if _globals.debug( self): 1359 _globals.writeLog( self, '[localfs_read]: filename=%s'%filename) 1359 1360 # Check permissions. 1360 1361 access = False … … 1386 1387 Writes file to local file-system. 1387 1388 """ 1388 _globals.writeBlock( self, '[localfs_write]: filename=%s'%filename) 1389 if _globals.debug( self): 1390 _globals.writeLog( self, '[localfs_write]: filename=%s'%filename) 1389 1391 _fileutil.exportObj( v, filename, mode) 1390 1392 … … 1397 1399 Removes file from local file-system. 1398 1400 """ 1399 _globals.writeBlock( self, '[localfs_remove]: path=%s'%path) 1401 if _globals.debug( self): 1402 _globals.writeLog( self, '[localfs_remove]: path=%s'%path) 1400 1403 _fileutil.remove( path, deep) 1401 1404 … … 1413 1416 except: 1414 1417 pass 1415 _globals.writeBlock( self, '[localfs_readPath]: filename=%s'%filename) 1418 if _globals.debug( self): 1419 _globals.writeLog( self, '[localfs_readPath]: filename=%s'%filename) 1416 1420 return _fileutil.readPath(filename, data, recursive) 1417 1421
Note: See TracChangeset
for help on using the changeset viewer.
