Beispiel #1
0
def init_sate(sate_home=None):
    """
    Sets the _DEFAULT_TOOLS_PATH.
    """
    global _DEFAULT_TOOLS_PATH
    bin_dir = sate.sate_tools_deploy_dir(default_to_dev_dir=True)
    if _DEFAULT_TOOLS_PATH is None:
        _DEFAULT_TOOLS_PATH = {}
    for i in get_external_tool_classes():
        tool_name = i.section_name.split()[0]
        _DEFAULT_TOOLS_PATH[tool_name] = os.path.join(bin_dir, tool_name)
        if platform.system() == 'Windows' and tool_name != 'opal':
            _DEFAULT_TOOLS_PATH[tool_name] += '.exe'
    _DEFAULT_TOOLS_PATH['opal'] += '.jar'
Beispiel #2
0
def init_sate(sate_home=None):
    """
    Sets the _DEFAULT_TOOLS_PATH.
    """
    global _DEFAULT_TOOLS_PATH
    bin_dir = sate.sate_tools_deploy_dir(default_to_dev_dir=True)
    if _DEFAULT_TOOLS_PATH is None:
        _DEFAULT_TOOLS_PATH = {}
    for i in get_external_tool_classes():
        tool_name = i.section_name.split()[0]
        _DEFAULT_TOOLS_PATH[tool_name] = os.path.join(bin_dir, tool_name)
        if platform.system() == 'Windows' and tool_name != 'opal':
            _DEFAULT_TOOLS_PATH[tool_name] += '.exe'
    _DEFAULT_TOOLS_PATH['opal'] += '.jar'
Beispiel #3
0
if sys.argv[1] == 'py2exe':
    sys.stderr.write(
        "\nMoving 'mafft.exe' into bundled binary directory ... \n")
    src_path = os.path.join(PY2EXE_DIST_DIR, "mafft.exe")
    dest_path = os.path.join(PY2EXE_DIST_DIR, bin_win_dest, "mafft.exe")
    if os.path.exists(dest_path):
        os.remove(dest_path)
    os.rename(src_path, dest_path)
    sys.stderr.write("OK\n")

# On Linux and OS X systems, sym-link all tool scripts
# to `bin` subdirectory, so SATe can be run from the command-line
# I know this is ugly. Trust me, I hate it as much as you do.
if platform.system() != "Windows":

    DEST_DIR_ROOT = sate.sate_tools_deploy_dir(default_to_dev_dir=False)

    def create_symlink(src_path, subdir=None):
        if subdir:
            dest_dir = os.path.join(DEST_DIR_ROOT, subdir)
        else:
            dest_dir = DEST_DIR_ROOT
        dest_path = os.path.join(dest_dir, os.path.basename(src_path))
        sys.stderr.write("\nCreating link: '%s' => '%s'\n" %
                         (src_path, dest_path))
        if os.path.exists(dest_path) and os.path.islink(dest_path):
            real_dest = os.path.abspath(os.path.realpath(dest_path))
            if real_dest != os.path.abspath(os.path.realpath(src_path)):
                msg = "ERROR: Symbolic link '%s' already exists, but points to different source: '%s'\n[Aborting]\n" % (
                    dest_path, real_dest)
                sys.exit(msg)
Beispiel #4
0
    sys.stderr.write("\nMoving 'mafft.exe' into bundled binary directory ... \n")
    src_path = os.path.join(PY2EXE_DIST_DIR, "mafft.exe")
    dest_path = os.path.join(PY2EXE_DIST_DIR,
            bin_win_dest,
            "mafft.exe")
    if os.path.exists(dest_path):
        os.remove(dest_path)
    os.rename(src_path, dest_path)
    sys.stderr.write("OK\n")

# On Linux and OS X systems, sym-link all tool scripts
# to `bin` subdirectory, so SATe can be run from the command-line
# I know this is ugly. Trust me, I hate it as much as you do.
if platform.system() != "Windows":

    DEST_DIR_ROOT = sate.sate_tools_deploy_dir(default_to_dev_dir=False)
    def create_symlink(src_path, subdir=None):
        if subdir:
            dest_dir = os.path.join(DEST_DIR_ROOT, subdir)
        else:
            dest_dir = DEST_DIR_ROOT
        dest_path = os.path.join(dest_dir, os.path.basename(src_path))
        sys.stderr.write("\nCreating link: '%s' => '%s'\n" % (src_path, dest_path))
        if os.path.exists(dest_path) and os.path.islink(dest_path):
            real_dest = os.path.abspath(os.path.realpath(dest_path))
            if real_dest != os.path.abspath(os.path.realpath(src_path)):
                msg = "ERROR: Symbolic link '%s' already exists, but points to different source: '%s'\n[Aborting]\n" % (dest_path, real_dest)
                sys.exit(msg)
            else:
                sys.stderr.write("Path already exists and is linked correctly.\n")
        elif os.path.exists(dest_path):