Changeset 4883
- Timestamp:
- 23 Jan 2010, 17:58:36 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/trunk/src/waeup/datacenter.py
r4873 r4883 10 10 from datetime import datetime 11 11 from zope.component import getMultiAdapter 12 from zope.component.interfaces import ObjectEvent 12 13 from waeup.csvfile import getCSVFile 13 14 from waeup.interfaces import (IDataCenter, IWAeUPCSVImporter, 14 ICSVDataReceivers, IDataCenterFile) 15 ICSVDataReceivers, IDataCenterFile, 16 IDataCenterStorageMovedEvent) 15 17 from waeup.utils.helpers import copyFileSystemTree 16 18 … … 27 29 # We need a different logger for every site... 28 30 site = grok.getSite() 29 sitename = site.__name__31 sitename = getattr(site, '__name__', 'app') 30 32 loggername = 'waeup.sirp.%s.datacenter' % sitename 31 33 logger = logging.getLogger(loggername) … … 52 54 # application log. 53 55 logger.propagate = False 56 logger.setLevel(logging.DEBUG) 54 57 logger.addHandler(handler) 55 58 return logger … … 141 144 overwrite=overwrite) 142 145 self.storage = path 146 # Adjust logger... 147 logger = self.logger 148 handlers = logger.handlers 149 for handler in handlers: 150 logger.removeHandler(handler) 151 self._setupLogger(logger) 152 grok.notify(DataCenterStorageMovedEvent(self)) 143 153 return not_copied 144 154 … … 328 338 importer.receiverid = receiverid 329 339 self.importers.append(importer) 340 341 class DataCenterStorageMovedEvent(ObjectEvent): 342 """An event fired, when datacenter storage moves. 343 """ 344 grok.implements(IDataCenterStorageMovedEvent)
Note: See TracChangeset for help on using the changeset viewer.