def cmd_link(arg): """Display a Gatherer link for a card. Required: The card name. """ if not arg: raise UsageError('CARD') print(cards.url(arg))
def cmd_web(arg): """Open default web browser to a card or mtgdeckbuilder deck. Required: The card name or mtgdeckbuilder deck ID number. """ if not arg: raise UsageError("CARD|DECK_ID") elif re.match("\d+$", arg): webbrowser.open_new_tab("http://www.mtgdeckbuilder.net/Decks/ViewDeck/" + arg) else: webbrowser.open_new_tab(cards.url(arg))
def cmd_web(arg): """Open default web browser to a card or mtgdeckbuilder deck. Required: The card name or mtgdeckbuilder deck ID number. """ if not arg: raise UsageError('CARD|DECK_ID') elif re.match('\d+$', arg): webbrowser.open_new_tab( 'http://www.mtgdeckbuilder.net/Decks/ViewDeck/' + arg) else: webbrowser.open_new_tab(cards.url(arg))