예제 #1
0
 def __init__(self, func, lr_ID, lr_name, returns, unflatten, **params):        
     Setting.__init__(self, func, lr_ID, lr_name, returns, unflatten, **params)
     func = self.func
     this = self
     def wrapped(self,c,*args,**kwargs):
         if not self._can_access_setting(c.ID,this.ID):
             raise LockedException(this.ID,this.name,c.ID,self._owning_context(this.ID))
         return func(self,c,*args,**kwargs)
     self.func = wrapped
예제 #2
0
 def __init__(self, func, lr_ID, **params):        
     Setting.__init__(self, func, lr_ID, **params)
     setting_id = self.ID        
     def wrapped(self,c,*args,**kwargs):
         context_id = c.ID
         device_id = self.get_context_device_id(context_id)            
         device = self.get_device(device_id)
         try:
             return device.handle_request(setting_id,c,*args,**kwargs)
         except DeviceError, device_error:
             raise DeviceServerError(device_id,device_error)