Beispiel #1
0
def up(uid):
    create_service = '{0}/createService.js'.format(common.get_script_dir())

    skydns = docker.run(
        image='crosbymichael/skydns',
        detach=True,
        name=common.format_dockername('skydns', uid),
        command=['-nameserver', '8.8.8.8:53', '-domain', 'docker'])

    skydock = docker.run(
        image='crosbymichael/skydock',
        detach=True,
        name=common.format_dockername('skydock', uid),
        reflect=[('/var/run/docker.sock', 'rw')],
        volumes=[(create_service, '/createService.js', 'ro')],
        command=['-ttl', '30', '-environment', 'dev', '-s',
                 '/var/run/docker.sock',
                 '-domain', 'docker', '-name', 'skydns_{0}'.format(uid),
                 '-plugins',
                 '/createService.js'])

    skydns_config = docker.inspect(skydns)
    dns = skydns_config['NetworkSettings']['IPAddress']

    return {'dns': dns, 'docker_ids': [skydns, skydock]}
            pdb_name = file.replace(".so", ".pdb").replace(".dll", ".pdb")
            if isfile(pdb_name):
                pdb_file = pdb_name

    return source_file, pdb_file, target_file


if __name__ == "__main__":

    if len(sys.argv) != 2:
        fatal_error("Usage: finalize.py <module-name>")

    MODULE_NAME = sys.argv[1]
    source_file, pdb_file, target_file = find_binary()
    target_pdb_file = MODULE_NAME + ".pdb"

    if source_file:
        dest_folder = join(get_script_dir(), "../")

        # Copy the generated DLL
        copyfile(source_file, join(dest_folder, target_file))

        # Copy the generated PDB (if it was generated)
        if pdb_file:
            copyfile(pdb_file, join(dest_folder, target_pdb_file))

    else:
        fatal_error("Failed to find generated binary!")

    sys.exit(0)
Beispiel #3
0
def interrogate_module():
    """ Runs the interrogate module command """

    # Create module command
    cmd = [join_abs(get_panda_bin_path(), "interrogate_module")]
    cmd += ["-python-native"]

    if PandaSystem.get_major_version() > 1 or PandaSystem.get_minor_version(
    ) > 9:
        # Older panda3d versions don't have this
        cmd += ["-import", "panda3d.core"]

    cmd += ["-module", MODULE_NAME]
    cmd += ["-library", MODULE_NAME]
    cmd += ["-oc", "interrogate_module.cpp"]
    cmd += ["interrogate.in"]

    try_execute(*cmd)


if __name__ == "__main__":

    # Change into the source directory
    source_dir = join(get_script_dir(), "../source/")
    chdir(source_dir)

    interrogate()
    interrogate_module()

    sys.exit(0)
    cmd += ["-module", MODULE_NAME]
    cmd += ["-library", MODULE_NAME]
    cmd += ["-oc", "interrogate_module.cpp"]
    cmd += ["interrogate.in"]

    try_execute(*cmd)


if __name__ == "__main__":

    # Parameters
    # TODO: add reall param processing
    loglevel = logging.INFO
    param_offset = 0
    if sys.argv[1] == '-d' or sys.argv[1] == '--debug':
        loglevel = logging.DEBUG
        param_offset += 1
    logging.basicConfig(level=loglevel)

    MODULE_NAME = sys.argv[1 + param_offset]
    VERBOSE_LVL = int(sys.argv[2 + param_offset])

    # Change into the source directory
    source_dir = join(get_script_dir(), '..', 'source')
    chdir(source_dir)

    interrogate()
    interrogate_module()

    sys.exit(0)
Beispiel #5
0
            pdb_name = file.replace(".so", ".pdb").replace(".dll", ".pdb")
            if isfile(pdb_name):
                pdb_file = pdb_name

    return source_file, pdb_file, target_file

if __name__ == "__main__":

    if len(sys.argv) != 2:
        fatal_error("Usage: finalize.py <module-name>")

    MODULE_NAME = sys.argv[1]
    source_file, pdb_file, target_file = find_binary()
    target_pdb_file = MODULE_NAME + ".pdb"

    if source_file:
        dest_folder = join(get_script_dir(), "../")

        # Copy the generated DLL
        copyfile(source_file, join(dest_folder, target_file))

        # Copy the generated PDB (if it was generated)
        if pdb_file:
            copyfile(pdb_file, join(dest_folder, target_pdb_file))

    else:
        fatal_error("Failed to find generated binary!")

    sys.exit(0)
Beispiel #6
0

def interrogate_module():
    """ Runs the interrogate module command """

    # Create module command
    cmd = [join_abs(get_panda_bin_path(), "interrogate_module")]
    cmd += ["-python-native"]

    if PandaSystem.get_major_version() > 1 or PandaSystem.get_minor_version() > 9:
        # Older panda3d versions don't have this
        cmd += ["-import", "panda3d.core"]

    cmd += ["-module", MODULE_NAME]
    cmd += ["-library", MODULE_NAME]
    cmd += ["-oc", "interrogate_module.cpp"]
    cmd += ["interrogate.in"]

    try_execute(*cmd, verbose=VERBOSE_LVL != 0)

if __name__ == "__main__":

    # Change into the source directory
    source_dir = join(get_script_dir(), "../source/")
    chdir(source_dir)

    interrogate()
    interrogate_module()

    sys.exit(0)