예제 #1
0
def archetype(archetype_id):
    season_id = get_season_id()
    a = archs.load_archetype(archetype_id.replace('+', ' '),
                             season_id=season_id)
    view = Archetype(
        a, archs.load_archetypes_deckless_for(a.id, season_id=season_id),
        archs.load_matchups(a.id, season_id=season_id), season_id)
    return view.page()
예제 #2
0
def archetype(archetype_id: str) -> str:
    season_id = get_season_id()
    a = archs.load_archetype(archetype_id.replace('+', ' '),
                             season_id=season_id)
    deckless_archetypes = archs.load_archetypes_deckless_for(
        a.id, season_id=season_id)
    archetype_matchups = archs.load_matchups(a.id, season_id=season_id)
    view = Archetype(a, deckless_archetypes, archetype_matchups, season_id)
    return view.page()
예제 #3
0
def archetypes(deck_type: Optional[str] = None) -> str:
    tournament_only = validate_deck_type(
        deck_type, [DeckType.ALL, DeckType.TOURNAMENT]) == DeckType.TOURNAMENT
    season_id = get_season_id()
    deckless_archetypes = archs.load_archetypes_deckless(
        season_id=season_id, tournament_only=tournament_only)
    all_matchups = archs.load_matchups(season_id=season_id,
                                       tournament_only=tournament_only)
    view = Archetypes(deckless_archetypes,
                      all_matchups,
                      tournament_only=tournament_only)
    return view.page()
예제 #4
0
def person(person_id: str) -> str:
    p = ps.load_person_by_id_or_mtgo_username(person_id,
                                              season_id=get_season_id())
    person_cards = cs.load_cards(person_id=p.id, season_id=get_season_id())
    person_archetypes = archs.load_archetypes_deckless(
        person_id=p.id, season_id=get_season_id())
    all_archetypes = archs.load_archetypes_deckless(season_id=get_season_id())
    trailblazer_cards = cs.trailblazer_cards(p.id)
    unique_cards = cs.unique_cards_played(p.id)
    your_cards = {'unique': unique_cards, 'trailblazer': trailblazer_cards}
    person_matchups = archs.load_matchups(person_id=p.id,
                                          season_id=get_season_id())
    view = Person(p, person_cards, person_archetypes, all_archetypes,
                  person_matchups, your_cards, get_season_id())
    return view.page()
예제 #5
0
def archetype(archetype_id: str, deck_type: Optional[str] = None) -> str:
    tournament_only = validate_deck_type(
        deck_type, [DeckType.ALL, DeckType.TOURNAMENT]) == DeckType.TOURNAMENT
    season_id = get_season_id()
    a = archs.load_archetype(archetype_id.replace('+', ' '),
                             season_id=season_id,
                             tournament_only=tournament_only)
    deckless_archetypes = archs.load_archetypes_deckless_for(
        a.id, season_id=season_id, tournament_only=tournament_only)
    archetype_matchups = archs.load_matchups(archetype_id=a.id,
                                             season_id=season_id,
                                             tournament_only=tournament_only)
    view = Archetype(a,
                     deckless_archetypes,
                     archetype_matchups,
                     tournament_only=tournament_only,
                     season_id=season_id)
    return view.page()
예제 #6
0
def archetype(archetype_id):
    view = Archetype(archs.load_archetype(archetype_id),
                     archs.load_archetypes_deckless_for(archetype_id),
                     archs.load_matchups(archetype_id))
    return view.page()
예제 #7
0
def archetype(archetype_id):
    a = archs.load_archetype(archetype_id.replace('+', ' '))
    view = Archetype(a, archs.load_archetypes_deckless_for(a.id), archs.load_matchups(a.id))
    return view.page()