示例#1
0
 def get(self):
     providers = \
         [attrdict(name=s.split('.')[0],
                   url=users.create_login_url(self.request.get('continue'),
                                              federated_identity=s.lower()))
          for s in OPENID_PROVIDERS]
     self.render_response('login.html', providers=providers)
示例#2
0
 def character_add(name):
     print config.characters
     config.characters[name] = attrdict(
         name = name,
         builds = { },
         last_build = None,
         build = None,
     )
     return 'Character %s added' % name
示例#3
0
barbarian = attrdict({

    # bash
    'bash': (Barbarian._bash, Skill.rune_0),
    'clobber': (Barbarian._bash, Skill.rune_1),
    'onslaught': (Barbarian._bash, Skill.rune_2),
    'punish': (Barbarian._bash, Skill.rune_3),
    'instigation': (Barbarian._bash, Skill.rune_4),
    'pulverize': (Barbarian._bash, Skill.rune_5),

    # cleave
    'cleave': (Barbarian._cleave, Skill.rune_0),
    'rupture': (Barbarian._cleave, Skill.rune_1),
    'reaping_swing': (Barbarian._cleave, Skill.rune_2),
    'scattering_blast': (Barbarian._cleave, Skill.rune_3),
    'broad_sweep': (Barbarian._cleave, Skill.rune_4),
    'gathering_storm': (Barbarian._cleave, Skill.rune_5),

    # frenzy
    'frenzy': (Barbarian._frenzy, Skill.rune_0),
    'sidearm': (Barbarian._frenzy, Skill.rune_1),
    'triumph': (Barbarian._frenzy, Skill.rune_2),
    'vanguard': (Barbarian._frenzy, Skill.rune_3),
    'smite': (Barbarian._frenzy, Skill.rune_4),
    'maniac': (Barbarian._frenzy, Skill.rune_5),

    # hammer_of_the_ancients
    'hammer_of_the_ancients': (Barbarian._hammer_of_the_ancients, Skill.rune_0),
    'rolling_thunder': (Barbarian._hammer_of_the_ancients, Skill.rune_1),
    'smash': (Barbarian._hammer_of_the_ancients, Skill.rune_2),
    'the_devils_anvil': (Barbarian._hammer_of_the_ancients, Skill.rune_3),
    'thunderstrike': (Barbarian._hammer_of_the_ancients, Skill.rune_4),
    'birthright': (Barbarian._hammer_of_the_ancients, Skill.rune_5),

    # rend
    'rend': (Barbarian._rend, Skill.rune_0),
    'ravage': (Barbarian._rend, Skill.rune_1),
    'blood_lust': (Barbarian._rend, Skill.rune_2),
    'lacerate': (Barbarian._rend, Skill.rune_3),
    'mutilate': (Barbarian._rend, Skill.rune_4),
    'bloodbath': (Barbarian._rend, Skill.rune_5),

    # seismic_slam
    'seismic_slam': (Barbarian._seismic_slam, Skill.rune_0),
    'stagger': (Barbarian._seismic_slam, Skill.rune_1),
    'shattered_ground': (Barbarian._seismic_slam, Skill.rune_2),
    'rumble': (Barbarian._seismic_slam, Skill.rune_3),
    'strength_from_earth': (Barbarian._seismic_slam, Skill.rune_4),
    'cracking_rift': (Barbarian._seismic_slam, Skill.rune_5),

    # whirlwind
    'whirlwind': (Barbarian._whirlwind, Skill.rune_0),
    'dust_devils': (Barbarian._whirlwind, Skill.rune_1),
    'hurricane': (Barbarian._whirlwind, Skill.rune_2),
    'blood_funnel': (Barbarian._whirlwind, Skill.rune_3),
    'wind_shear': (Barbarian._whirlwind, Skill.rune_4),
    'volcanic_eruption': (Barbarian._whirlwind, Skill.rune_5),

    # ground_stomp
    'ground_stomp': (Barbarian._ground_stomp, Skill.rune_0),
    'deafening_crash': (Barbarian._ground_stomp, Skill.rune_1),
    'wrenching_smash': (Barbarian._ground_stomp, Skill.rune_2),
    'trembling_stomp': (Barbarian._ground_stomp, Skill.rune_3),
    'foot_of_the_mountain': (Barbarian._ground_stomp, Skill.rune_4),
    'avalanche': (Barbarian._ground_stomp, Skill.rune_5),

    # leap
    'leap': (Barbarian._leap, Skill.rune_0),
    'iron_impact': (Barbarian._leap, Skill.rune_1),
    'launch': (Barbarian._leap, Skill.rune_2),
    'toppling_impact': (Barbarian._leap, Skill.rune_3),
    'call_of_arreat': (Barbarian._leap, Skill.rune_4),
    'death_from_above': (Barbarian._leap, Skill.rune_5),

    # sprint
    'sprint': (Barbarian._sprint, Skill.rune_0),
    'rush': (Barbarian._sprint, Skill.rune_1),
    'run_like_the_wind': (Barbarian._sprint, Skill.rune_2),
    'marathon': (Barbarian._sprint, Skill.rune_3),
    'gangway': (Barbarian._sprint, Skill.rune_4),
    'forced_march': (Barbarian._sprint, Skill.rune_5),

    # ignore_pain
    'ignore_pain': (Barbarian._ignore_pain, Skill.rune_0),
    'bravado': (Barbarian._ignore_pain, Skill.rune_1),
    'iron_hide': (Barbarian._ignore_pain, Skill.rune_2),
    'ignorance_is_bliss': (Barbarian._ignore_pain, Skill.rune_3),
    'mob_rule': (Barbarian._ignore_pain, Skill.rune_4),
    'contempt_for_weakness': (Barbarian._ignore_pain, Skill.rune_5),

    # ancient_spear
    'ancient_spear': (Barbarian._ancient_spear, Skill.rune_0),
    'grappling_hooks': (Barbarian._ancient_spear, Skill.rune_1),
    'skirmish': (Barbarian._ancient_spear, Skill.rune_2),
    'dread_spear': (Barbarian._ancient_spear, Skill.rune_3),
    'harpoon': (Barbarian._ancient_spear, Skill.rune_4),
    'rage_flip': (Barbarian._ancient_spear, Skill.rune_5),

    # revenge
    'revenge': (Barbarian._revenge, Skill.rune_0),
    'vengeance_is_mine': (Barbarian._revenge, Skill.rune_1),
    'best_served_cold': (Barbarian._revenge, Skill.rune_2),
    'retribution': (Barbarian._revenge, Skill.rune_3),
    'grudge': (Barbarian._revenge, Skill.rune_4),
    'provocation': (Barbarian._revenge, Skill.rune_5),

    # furious_charge
    'furious_charge': (Barbarian._furious_charge, Skill.rune_0),
    'battering_ram': (Barbarian._furious_charge, Skill.rune_1),
    'merciless_assault': (Barbarian._furious_charge, Skill.rune_2),
    'stamina': (Barbarian._furious_charge, Skill.rune_3),
    'bull_rush': (Barbarian._furious_charge, Skill.rune_4),
    'dreadnought': (Barbarian._furious_charge, Skill.rune_5),

    # overpower
    'overpower': (Barbarian._overpower, Skill.rune_0),
    'storm_of_steel': (Barbarian._overpower, Skill.rune_1),
    'killing_spree': (Barbarian._overpower, Skill.rune_2),
    'crushing_advance': (Barbarian._overpower, Skill.rune_3),
    'momentum': (Barbarian._overpower, Skill.rune_4),
    'revel': (Barbarian._overpower, Skill.rune_5),

    # weapon_throw
    'weapon_throw': (Barbarian._weapon_throw, Skill.rune_0),
    'mighty_throw': (Barbarian._weapon_throw, Skill.rune_1),
    'ricochet': (Barbarian._weapon_throw, Skill.rune_2),
    'throwing_hammer': (Barbarian._weapon_throw, Skill.rune_3),
    'stupefy': (Barbarian._weapon_throw, Skill.rune_4),
    'dread_bomb': (Barbarian._weapon_throw, Skill.rune_5),

    # threatening_shout
    'threatening_shout': (Barbarian._threatening_shout, Skill.rune_0),
    'intimidate': (Barbarian._threatening_shout, Skill.rune_1),
    'falter': (Barbarian._threatening_shout, Skill.rune_2),
    'grim_harvest': (Barbarian._threatening_shout, Skill.rune_3),
    'demoralize': (Barbarian._threatening_shout, Skill.rune_4),
    'terrify': (Barbarian._threatening_shout, Skill.rune_5),

    # battle_rage
    'battle_rage': (Barbarian._battle_rage, Skill.rune_0),
    'marauders_rage': (Barbarian._battle_rage, Skill.rune_1),
    'ferocity': (Barbarian._battle_rage, Skill.rune_2),
    'swords_to_ploughshares': (Barbarian._battle_rage, Skill.rune_3),
    'into_the_fray': (Barbarian._battle_rage, Skill.rune_4),
    'bloodshed': (Barbarian._battle_rage, Skill.rune_5),

    # war_cry
    'war_cry': (Barbarian._war_cry, Skill.rune_0),
    'hardened_wrath': (Barbarian._war_cry, Skill.rune_1),
    'charge!': (Barbarian._war_cry, Skill.rune_2),
    'invigorate': (Barbarian._war_cry, Skill.rune_3),
    'veterans_warning': (Barbarian._war_cry, Skill.rune_4),
    'impunity': (Barbarian._war_cry, Skill.rune_5),

    # earthquake
    'earthquake': (Barbarian._earthquake, Skill.rune_0),
    'giants_stride': (Barbarian._earthquake, Skill.rune_1),
    'chilling_earth': (Barbarian._earthquake, Skill.rune_2),
    'the_mountains_call': (Barbarian._earthquake, Skill.rune_3),
    'aftershocks': (Barbarian._earthquake, Skill.rune_4),
    'path_of_fire': (Barbarian._earthquake, Skill.rune_5),

    # call_of_the_ancients
    'call_of_the_ancients': (Barbarian._call_of_the_ancients, Skill.rune_0),
    'the_council_rises': (Barbarian._call_of_the_ancients, Skill.rune_1),
    'duty_to_the_clan': (Barbarian._call_of_the_ancients, Skill.rune_2),
    'korlics_might': (Barbarian._call_of_the_ancients, Skill.rune_3),
    'madawcs_madness': (Barbarian._call_of_the_ancients, Skill.rune_4),
    'talics_anger': (Barbarian._call_of_the_ancients, Skill.rune_5),

    # wrath_of_the_berserker
    'wrath_of_the_berserker': (Barbarian._wrath_of_the_berserker, Skill.rune_0),
    'arreats_wail': (Barbarian._wrath_of_the_berserker, Skill.rune_1),
    'insanity': (Barbarian._wrath_of_the_berserker, Skill.rune_2),
    'slaughter': (Barbarian._wrath_of_the_berserker, Skill.rune_3),
    'striding_giant': (Barbarian._wrath_of_the_berserker, Skill.rune_4),
    'thrive_on_chaos': (Barbarian._wrath_of_the_berserker, Skill.rune_5),

    # Passives
    'pound_of_flesh': Skill.passive_0_0,
    'ruthless': Skill.passive_0_1,
    'nerves_of_steel': Skill.passive_0_2,
    'weapons_master': Skill.passive_0_3,
    'berserker_rage': Skill.passive_1_0,
    'inspiring_presence': Skill.passive_1_1,
    'bloodthirst': Skill.passive_1_2,
    'animosity': Skill.passive_1_3,
    'superstition': Skill.passive_2_0,
    'tough_as_nails': Skill.passive_2_1,
    'no_escape': Skill.passive_2_2,
    'relentless': Skill.passive_2_3,
    'brawler': Skill.passive_3_4_0,
    'juggernaut': Skill.passive_3_4_1,
    'unforgiving': Skill.passive_3_4_2,
    'boon_of_bulkathos': Skill.passive_3_4_3,

})
示例#4
0
 def build_add(name):
     character = config.characters[config.current_character]
     character.builds[name] = attrdict(
         name = name,
     )
     return 'Added build %s' % name
示例#5
0
        BUILD: {
            ADD: build_add,
            USE: build_use,
            SWITCH: build_switch,
            REMOVE: build_remove,
            LIST: build_list,
            SHOW: build_show,
            ASSIGN: build_assign,
            STORE: build_store,
            REVERT: build_revert,
        }
    }
    if section in handlers:
        return handlers[section].get(command, Errorf)(*arguments)

if __name__ == '__main__':
    fpath = 'mybuilds'
    config = attrdict(
        characters = { },
        current_character = None
    )
    if os.path.exists(fpath):
        with open(fpath) as fin:
            try:
                config = Rattrdict(json.load(fin)) or config
            except Exception, e:
                print e
    print handle_input(config, sys.argv[1:])
    with open('mybuilds', 'w') as fout:
        json.dump(config, fout, indent = 2)