Exemplo n.º 1
0
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)
Exemplo n.º 2
0
 def __init__(self, *args):
     self.objects = dict()
     self.readOnly = rpyc.restricted(
         self, {
             "__getattribute__", "__getitem__", "__repr__", "copy", "keys",
             "values", "items", "__contains__", "__len__"
         })
Exemplo n.º 3
0
 def exposed_get_one(self):
     return rpyc.restricted(MyClass(), ["foo", "bar"])
Exemplo n.º 4
0
 def exposed_get_one(self):
     return rpyc.restricted(MyClass(), SVC_RESTRICTED)
Exemplo n.º 5
0
 def exposed_get_one(self):
     return rpyc.restricted(MyClass(), ["foo", "bar"])