def load(self, name=None): if name: names = [name] else: names = self._subclass_instance_names() # add whatever has been deleted but not saved. names.extend(self._delete) names.append('__meta__') self._delete = [] try: value_dict = self._persistent.get_values(names) except: file = open(self._persistent.filename, 'r') data = file.read() file.close() if string.find(self.__name, 'msglog') == -1: try: from mpx.lib import msglog msglog.log('broadway', msglog.types.WARN, 'Deleting corrupted persistent data: %s' % data) msglog.exception() except: print 'Warning, unable to log PDO load failure: %s' % data else: print 'Failure while loading msglog PDO: %s' % data self.__reset() else: self._loaded = value_dict.keys() self.__dict__.update(value_dict)
def load(self, name=None): if name: names = [name] else: names = self._subclass_instance_names() # add whatever has been deleted but not saved. names.extend(self._delete) names.append('__meta__') self._delete = [] try: value_dict = self._persistent.get_values(names) except: file = open(self._persistent.filename,'r') data = file.read() file.close() if string.find(self.__name,'msglog') == -1: try: from mpx.lib import msglog msglog.log('broadway',msglog.types.WARN, 'Deleting corrupted persistent data: %s' % data) msglog.exception() except: print 'Warning, unable to log PDO load failure: %s' % data else: print 'Failure while loading msglog PDO: %s' % data self.__reset() else: self._loaded = value_dict.keys() self.__dict__.update(value_dict)
def unwind_callbacks(self,result,*args,**keywords): spent,self.__spent = self.__spent,1 if spent: msglog.log('broadway',msglog.types.DB, 'Callback being double-rewound. ' 'Callback instance %s, with str "%s"' % (self,str(self))) msglog.traceback() raise Exception('Callback already rewound') self.unwind_queue.enqueue(self._runwind,result,*args,**keywords)
def unwind_callbacks(self, result, *args, **keywords): spent, self.__spent = self.__spent, 1 if spent: msglog.log( 'broadway', msglog.types.DB, 'Callback being double-rewound. ' 'Callback instance %s, with str "%s"' % (self, str(self))) msglog.traceback() raise Exception('Callback already rewound') self.unwind_queue.enqueue(self._runwind, result, *args, **keywords)