def read_data_and_derive_df_list(tsv_filename):
    make_gzip(this_file=__file__, filename=tsv_filename)
    df = read_compressed_tsv(this_file=__file__, filename=tsv_filename + ".gz")
    df.columns = trade_skill_trainer_gps_columns
    df = remove_go_cmd_construct_teleport(df)

    def construct_img(trade_skill_name):
        if trade_skill_name in img_trade_skill:
            return Image(uri=img_trade_skill[trade_skill_name],
                         width=64,
                         height=64)
        else:
            return trade_skill_name

    label_column = "商业技能"
    df_list = [[label, df[df[label_column] == label].copy()]
               for label in df[label_column].unique()]
    for pair in df_list:
        trade_skill_name = pair[0]
        sub_df = pair[1]
        sub_df[label_column] = sub_df[label_column].apply(construct_img)
        pair[1] = df_to_list_table(sub_df, title="{}".format(trade_skill_name))

    lt_list = df_list
    return lt_list
Exemplo n.º 2
0
def read_data_and_derive_df_list(tsv_filename):
    make_gzip(this_file=__file__, filename=tsv_filename)
    df = read_compressed_tsv(this_file=__file__, filename=tsv_filename + ".gz")
    df.columns = zone_gps_columns
    df = remove_go_cmd_construct_teleport(df)
    lt_list = disaggregate_df_transform_to_list_table(df, "地图")
    return lt_list
def read_data_and_derive_df_list(tsv_filename):
    make_gzip(this_file=__file__, filename=tsv_filename)
    df = read_compressed_tsv(this_file=__file__, filename=tsv_filename + ".gz")
    df.columns = class_trainer_gps_columns
    df = remove_go_cmd_construct_teleport(df)
    df["职业"] = df["职业"].apply(lambda v: Image(uri=img_class_icon[v]))
    lt_list = disaggregate_df_transform_to_list_table(df, "阵营")
    return lt_list
Exemplo n.º 4
0
# -*- coding: utf-8 -*-

from wotlkdoc.compressed_tsv import make_gzip, read_compressed_tsv
from wotlkdoc.df_to_list_table import df_to_list_table

tsv_filename = "buff-item.tsv"
make_gzip(this_file=__file__, filename=tsv_filename)
df = read_compressed_tsv(this_file=__file__, filename=tsv_filename + ".gz")
df.columns = ("资料片,类型,效果类型,名称,效果,添加物品命令").split(",")


def construct_list_table(expansion):
    return df_to_list_table(
        df=df[df["资料片"] == expansion].copy().drop(columns=[
            "资料片",
        ]),
        title="{}合剂, 药剂, 药水, 食物和饮料".format(expansion),
        code_column_and_transform_func={
            "添加物品命令":
            lambda row: ".add {id} -20\n.add {id} 20 # {name}".format(
                id=row["添加物品命令"], name=row["名称"])
        },
    )


lt_consumable_vanilla = construct_list_table("经典旧世")
lt_consumable_tbc = construct_list_table("燃烧的远征")
lt_consumable_wlk = construct_list_table("巫妖王之怒")

if __name__ == "__main__":
    print(lt_consumable_vanilla.render())
Exemplo n.º 5
0
# -*- coding: utf-8 -*-

from wotlkdoc.compressed_tsv import make_gzip, read_compressed_tsv
from wotlkdoc.df_to_list_table import df_to_list_table

make_gzip(this_file=__file__, filename="all-mount.tsv")
df = read_compressed_tsv(this_file=__file__, filename="all-mount.tsv.gz")
lt_mount = df_to_list_table(
    df,
    title="坐骑相关GM命令",
    code_column_and_transform_func={
        "添加坐骑": None,
        "上马命令": None
    },
)

if __name__ == "__main__":
    print(lt_mount.render())