Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
 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)