def redirect_stdio(stdin=None, stdout=None, stderr=None): """ Redirect the remote stdio to wherever you want! The most common place to redirect the remote stdio is to our local stdio. E.g. `redirect_stdio(stdout=sys.stdout)` """ if stdin is not None: stdin = rpyc.restricted(stdin, {'read'}) if stdout is not None: stdout = rpyc.restricted(stdout, {'write', 'flush'}) if stderr is not None: stderr = rpyc.restricted(stderr, {'write', 'flush'}) CONN.root.redirect_stdio(stdin=stdin, stdout=stdout, stderr=stderr)
def __init__(self, *args): self.objects = dict() self.readOnly = rpyc.restricted( self, { "__getattribute__", "__getitem__", "__repr__", "copy", "keys", "values", "items", "__contains__", "__len__" })
def exposed_get_one(self): return rpyc.restricted(MyClass(), ["foo", "bar"])
def exposed_get_one(self): return rpyc.restricted(MyClass(), SVC_RESTRICTED)
def exposed_get_one(self): return rpyc.restricted(MyClass(), ["foo", "bar"])