def _js_slot(*args):
 def _decorator(method):
  @functools.wraps(method)
  def new_method(self, *args, **kwargs):
   try:
    return method(self, *args, **kwargs)
   except:
    e = str(sys.exc_info()[0])
    log.network.exception('PAC evaluation error')
    return self._error_con.callAsConstructor([e])
  return pyqtSlot(result=QJSValue, *args)(new_method)
 return _decorator

def _js_slot ( * args ) : def _decorator ( method ) : @ functools . wraps ( method ) def new_method ( self , * args , ** kwargs ) : try : return method ( self , * args , ** kwargs ) except : e = str ( sys . exc_info ( ) [ 0 ] ) log . network . exception ( 'PAC evaluation error' ) return self . _error_con . callAsConstructor ( [ e ] ) return pyqtSlot ( result = QJSValue , * args ) ( new_method ) return _decorator
wrap a methods as a javascript function .