Esempio n. 1
0
def connect_subproc():
    """Runs an RPyC classic server as a subprocess and return an RPyC
    connection to it over stdio
    
    :returns: an RPyC connection exposing ``SlaveService``
    """
    return factory.connect_subproc([sys.executable, "-u", SERVER_FILE, "-q", "-m", "stdio"], SlaveService)
Esempio n. 2
0
def connect_subproc():
    """Runs an RPyC classic server as a subprocess and return an RPyC
    connection to it over stdio
    
    :returns: an RPyC connection exposing ``SlaveService``
    """
    return factory.connect_subproc(
        [sys.executable, "-u", SERVER_FILE, "-q", "-m", "stdio"], SlaveService)
Esempio n. 3
0
def connect_subproc(server_file=None):
    """Runs an RPyC classic server as a subprocess and returns an RPyC
    connection to it over stdio
    
    :param server_file: The full path to the server script (``rpyc_classic.py``). 
                        If not given, ``which rpyc_classic.py`` will be attempted.
    
    :returns: an RPyC connection exposing ``SlaveService``
    """
    if server_file is None:
        server_file = os.popen("which rpyc_classic.py").read().strip()
        if not server_file:
            raise ValueError("server_file not given and could not be inferred")
    return factory.connect_subproc(
        [sys.executable, "-u", server_file, "-q", "-m", "stdio"], SlaveService)
Esempio n. 4
0
def connect_subproc(server_file = None):
    """Runs an RPyC classic server as a subprocess and returns an RPyC
    connection to it over stdio
    
    :param server_file: The full path to the server script (``rpyc_classic.py``). 
                        If not given, ``which rpyc_classic.py`` will be attempted.
    
    :returns: an RPyC connection exposing ``SlaveService``
    """
    if server_file is None:
        server_file = os.popen("which rpyc_classic.py").read().strip()
        if not server_file:
            raise ValueError("server_file not given and could not be inferred")
    return factory.connect_subproc([sys.executable, "-u", server_file, "-q", "-m", "stdio"],
        SlaveService)
Esempio n. 5
0
def connect_another_py(server_file=None):
    """Runs an RPyC classic server as a subprocess and returns an RPyC
    connection to it over stdio

    :param server_file: The full path to the server script (``rpyc_classic.py``).
                        If not given, ``which rpyc_classic.py`` will be attempted.

    :returns: an RPyC connection exposing ``SlaveService``
    """
    from rpyc.utils import factory
    from rpyc.lib.compat import is_py3k
    from rpyc.core.service import ClassicService
    if server_file is None:
        server_file = os.popen("which rpyc_classic.py").read().strip()
        if not server_file:
            raise ValueError("server_file not given and could not be inferred")
    py_version = "-2" if is_py3k else "-3"
    print("connecting to py %s" % py_version)
    return factory.connect_subproc(
        ["py", py_version, "-u", server_file, "-q", "-m", "stdio"],
        ClassicService)
Esempio n. 6
0
def connect_subproc():
    """runs an rpyc classic server as a subprocess and return an rpyc
    connection to it"""
    return factory.connect_subproc([sys.executable, "-u", SERVER_FILE, "-q", "-m", "stdio"], 
        SlaveService)
Esempio n. 7
0
def connect_subproc():
    """runs an rpyc classic server as a subprocess and return an rpyc
    connection to it"""
    return factory.connect_subproc(
        [sys.executable, "-u", SERVER_FILE, "-q", "-m", "stdio"], SlaveService)