示例#1
0
def extract_exh(args, conf):
    dat_manager = DatManager(conf.get('game', 'path'))
    exd_manager = ExdManager(dat_manager)

    output_path = path.join(conf.get('output', 'path'), 'exh')

    for category_name in exd_manager.get_categories():
        struct_def = exd_manager.get_category(category_name).get_struct_def()
        output_file_path = path.join(
            output_path,
            'exd/%s.exh' % category_name)

        if not path.exists(path.dirname(output_file_path)):
            makedirs(path.dirname(output_file_path))

        with open(output_file_path, 'w') as file_handle:
            for line in struct_def:
                file_handle.write(line)
                file_handle.write('\n')
示例#2
0
def extract_exd(args, conf):
    dat_manager = DatManager(conf.get('game', 'path'))
    exd_manager = ExdManager(dat_manager)

    output_path = path.join(conf.get('output', 'path'), 'exd')

    for category_name in exd_manager.get_categories():
        data = exd_manager.get_category(category_name).get_csv()
        for language, csv in data.items():
            output_file_path = path.join(
                output_path,
                'exd/%s_%s.exd' % (category_name, get_language_name(language)))

            if not path.exists(path.dirname(output_file_path)):
                makedirs(path.dirname(output_file_path))

            with open(output_file_path, 'w') as file_handle:
                for line in csv:
                    file_handle.write(line)
                    file_handle.write('\n')