Example #1
0
def get_python_c_args(host, port, indC, args, setup):
    runner = '''
import sys
sys.path.append(r'{ptvsd_syspath}')
from ptvsd import multiproc
multiproc.init_subprocess(
    {initial_pid},
    {initial_request},
    {parent_pid},
    {parent_port},
    {first_port},
    {last_port},
    {pydevd_setup})
{rest}
'''

    first_port, last_port = multiproc.subprocess_port_range

    # __file__ will be .../ptvsd/__init__.py, and we want the ...
    ptvsd_syspath = os.path.join(ptvsd.__file__, '../..')

    return runner.format(initial_pid=multiproc.initial_pid,
                         initial_request=multiproc.initial_request,
                         parent_pid=os.getpid(),
                         parent_port=multiproc.listener_port,
                         first_port=first_port,
                         last_port=last_port,
                         ptvsd_syspath=ptvsd_syspath,
                         pydevd_setup=setup,
                         rest=args[indC + 1])
Example #2
0
def get_python_c_args(host, port, indC, args, setup):
    runner = '''
import sys
sys.path.append(r'{ptvsd_syspath}')
from ptvsd import multiproc
multiproc.init_subprocess(
    {initial_pid},
    {initial_request},
    {parent_pid},
    {parent_port},
    {first_port},
    {last_port},
    {pydevd_setup})
{rest}
'''

    first_port, last_port = multiproc.subprocess_port_range

    # __file__ will be .../ptvsd/__init__.py, and we want the ...
    ptvsd_syspath = os.path.join(ptvsd.__file__, '../..')

    return runner.format(
        initial_pid=multiproc.initial_pid,
        initial_request=multiproc.initial_request,
        parent_pid=os.getpid(),
        parent_port=multiproc.listener_port,
        first_port=first_port,
        last_port=last_port,
        ptvsd_syspath=ptvsd_syspath,
        pydevd_setup=setup,
        rest=args[indC + 1])