Changeset 5254 for main/waeup.sirp/branches/ulif-fasttables/src/waeup
- Timestamp:
- 27 Jun 2010, 09:43:39 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/jambtables/jambtables.py
r5248 r5254 70 70 grok.implements(IJAMBDataTable) 71 71 72 #: The datetime when data was imported. 72 73 import_datetime = None 74 75 #: The username of the person that initiated the last import. 76 importer_username = None 73 77 74 78 def __init__(self): … … 107 111 def clear(self): 108 112 """Remove all existing entries. 113 114 Unsets also the :attr:`import_datetime` and 115 :attr:`importer_username` attributes. 109 116 """ 110 117 self.import_datetime = None 118 self.importer_username = None 111 119 if self._datafile_path is None: 112 120 return … … 117 125 self._datafile_path = None 118 126 119 def importFromCSV(self, filepath ):127 def importFromCSV(self, filepath, username=None): 120 128 """Importing data from a CSV file means to copy the source to a safe 121 129 location. 130 131 If the username is set, it will be stored as well in 132 :attr:`importer_username`. 122 133 """ 123 134 self.clear() 124 135 self.import_datetime = datetime.now() 136 self.importer_username = None 137 if username is not None: 138 self.importer_username = unicode(username) 125 139 self._copyDataFile(filepath) 126 140
Note: See TracChangeset for help on using the changeset viewer.