Пример #1
0
 def make_values(self, a_card):
     return (
         """<td class="{attr_class}"> <a href="/char/{card.chara_id}#c_{card.id}_head">{icon_id}</a> </td>"""
         """<td class="{attr_class}"> <a href="/char/{card.chara_id}#c_{card.id}_head">{tle_translate}</a><br> <small>{tle_title}</small> </td>"""
     ).format(card=a_card,
              tle_translate=starlight.data.translate_name(a_card.name_only),
              tle_title=webutil.tlable(a_card.title)
              if a_card.title_flag else "",
              icon_id=webutil.icon(a_card.id),
              attr_class=E(enums.attribute(a_card.attribute)))
Пример #2
0
 def make_values(self, a_card):
     return (
         """<td class="{attr_class}"> <a href="/char/{card.chara_id}#c_{card.id}_head">{icon_id}</a> </td>"""
         """<td class="{attr_class}"> <a href="/char/{card.chara_id}#c_{card.id}_head">{tle_translate}</a><br> <small>{tle_title}</small> </td>"""
     ).format(
         card=a_card,
         tle_translate=a_card.name_only,#starlight.data.translate_name(a_card.name_only)
         tle_title=webutil.tlable(a_card.title) if a_card.title_flag else "",
         icon_id=webutil.icon(a_card.id),
         attr_class=E(enums.attribute(a_card.attribute))
     )
Пример #3
0
import enums
import starlight
from tornado.escape import xhtml_escape

E = xhtml_escape

# TODO: for this entire file, extract all english strings and put them in starlight.en,
# or maybe use tornado's localization module?

option_t = namedtuple("option_t", ("name", "kill_class"))
filter_t = namedtuple("filter_t", ("name", "options", "gen_object_class"))

card_attribute = filter_t(
    "Idol Attribute", (option_t("Cute", "Cute_kc"), option_t(
        "Cool", "Cool_kc"), option_t("Passion", "Passion_kc")),
    lambda card: enums.attribute(card.attribute) + "_kc")

rarity = filter_t("Card Rarity",
                  (option_t("SSR", "ssr_kc"), option_t("SR", "sr_kc"),
                   option_t("R", "r_kc"), option_t("N", "n_kc")),
                  lambda card: enums.floor_rarity(card.rarity) + "_kc")

skill_type = filter_t(
    "Skill Type",
    (option_t("Perf. Lock*", "s_pl"), option_t(
        "C. Guard", "s_cprot"), option_t("Combo Bonus", "s_combobonus"),
     option_t("Score Bonus", "s_scorebonus"), option_t("Healer", "s_heal"),
     option_t("H. Guard", "s_life"), option_t("Overload", "s_overload"),
     option_t("All-Round", "s_allround"), option_t("Concen.", "s_perfelegant"),
     option_t("Skill Boost", "s_sb"), option_t("Focus", "s_focus")),
    lambda card: enums.skill_class(card.skill.skill_type)
Пример #4
0
import starlight
from tornado.escape import xhtml_escape

E = xhtml_escape

# TODO: for this entire file, extract all english strings and put them in starlight.en,
# or maybe use tornado's localization module?

option_t = namedtuple("option_t", ("name", "kill_class"))
filter_t = namedtuple("filter_t", ("name", "options", "gen_object_class"))

card_attribute = filter_t("偶像属性", (
    option_t("Cute",      "Cute_kc"),
    option_t("Cool",      "Cool_kc"),
    option_t("Passion",   "Passion_kc")),
lambda card: enums.attribute(card.attribute) + "_kc")

rarity = filter_t("卡牌稀有度", (
    option_t("SSR", "ssr_kc"),
    option_t("SR",  "sr_kc"),
    option_t("R",   "r_kc"),
    option_t("N",   "n_kc")),
lambda card: enums.floor_rarity(card.rarity) + "_kc")

skill_type = filter_t("特技类型", (
    option_t("强判",       "s_pl"),
    option_t("不断连",     "s_cprot"),
    option_t("C分",        "s_combobonus"),
    option_t("P分",        "s_scorebonus"),
    option_t("奶妈",       "s_heal"),
    option_t("血盾",       "s_life"),