basechart.py 文件源码

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

项目:SMAC-M 作者: LarsSchy 项目源码 文件源码
def create_legend_files(template_path, themes_path, map_path, fonts_path, use_debug):
    template = Template( open( os.path.join(template_path, "SeaChart_Legend_THEME.map"), 'r' ).read() )
    for theme in os.listdir(themes_path):
        # Remove file suffix
        theme = os.path.splitext(theme)[0]

        debug_string = ""
        if use_debug:
            debug_string = str.format(debug_template, theme)

        d = get_dictionary(theme, map_path, fonts_path, debug_string)

        legend_path = dirutils.force_sub_dir(map_path, "legends")

        fileout = open( os.path.join(legend_path, "SeaChart_Legend_" + theme + ".map"), 'w' )
        fileout.write( template.substitute(d) )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号