java_helper.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:ac_pysmac 作者: belkhir-nacim 项目源码 文件源码
def smac_classpath():
    """
    Small function gathering all information to build the java class path.

    :returns: string representing the Java classpath for SMAC

    """
    import multiprocessing
    from pkg_resources import resource_filename

    logger = multiprocessing.get_logger()

    smac_folder = resource_filename("ac_pysmac", 'smac/%s' % ac_pysmac.remote_smac.SMAC_VERSION)

    smac_conf_folder = os.path.join(smac_folder, "conf")
    smac_patches_folder = os.path.join(smac_folder, "patches")
    smac_lib_folder = os.path.join(smac_folder, "lib")

    classpath = [fname for fname in os.listdir(smac_lib_folder) if fname.endswith(".jar")]
    classpath = [os.path.join(smac_lib_folder, fname) for fname in classpath]
    classpath = [os.path.abspath(fname) for fname in classpath]
    classpath.append(os.path.abspath(smac_conf_folder))
    classpath.append(os.path.abspath(smac_patches_folder))

    # For Windows compability
    classpath = (os.pathsep).join(classpath)
    logger.debug("SMAC classpath: %s", classpath)
    return classpath
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号