- Timestamp:
- 21 Sep 2012, 08:19:35 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
/main/waeup.kofa/branches/uli-async-update removed /main/waeup.kofa/branches/uli-autoinclude-less removed /main/waeup.kofa/trunk removed
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/datacenter.py
r9209 r9211 67 67 return os.path.join(self.storage, 'deleted') 68 68 69 def get PendingFiles(self, sort='name'):69 def getFiles(self, sort='name'): 70 70 """Get a list of files stored in `storage`. 71 71 … … 79 79 if not os.path.isfile(fullpath): 80 80 continue 81 if not filename.endswith('.csv'):82 continue83 81 result.append(DataCenterFile(fullpath)) 84 82 if sort == 'date': … … 86 84 result = sorted(result, key=lambda x: x.getTimeStamp(), 87 85 reverse=True) 88 return result89 90 def getFinishedFiles(self):91 """Get a list of files stored in `finished` subfolder of `storage`.92 93 Files are unsorted.94 """95 result = []96 finished_dir = os.path.join(self.storage, 'finished')97 if not os.path.exists(finished_dir):98 return result99 for filename in sorted(os.listdir(finished_dir)):100 fullpath = os.path.join(finished_dir, filename)101 if not os.path.isfile(fullpath):102 continue103 if not filename.endswith('.csv'):104 continue105 result.append(DataCenterFile(fullpath, 'finished'))106 86 return result 107 87 … … 164 144 return 165 145 result_path = merge_csv_files(dest, source) 166 os.chmod(result_path, 0664)167 146 self._moveFile(result_path, dest) 168 147 os.unlink(source) … … 319 298 grok.implements(IDataCenterFile) 320 299 321 def __init__(self, context , folder_name=''):300 def __init__(self, context): 322 301 self.context = context 323 302 self.name = os.path.basename(self.context) 324 self.rel_path = os.path.join(folder_name, self.name)325 303 self.size = self.getSize() 326 304 self.uploaddate = self.getDate()
Note: See TracChangeset for help on using the changeset viewer.