From 958cdaae89a0821fef48f69d19a54a5205dd7348 Mon Sep 17 00:00:00 2001 From: Nanda Scott Date: Tue, 30 Jan 2018 19:32:39 -0500 Subject: [PATCH] Renamed RandomCard to Random for ease of use. Also some stuff to autocomplete. --- cards/__init__.py | 2 +- cards/autocomplete.py | 6 +++--- cards/randomcard.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cards/__init__.py b/cards/__init__.py index 08911e0..f0f191d 100644 --- a/cards/__init__.py +++ b/cards/__init__.py @@ -4,4 +4,4 @@ from .cardid import Id from .mtgo import Mtgo from .multiverse import Multiverse from .named import Named -from .randomcard import RandomCard +from .randomcard import Random diff --git a/cards/autocomplete.py b/cards/autocomplete.py index 40a8acf..99517b7 100644 --- a/cards/autocomplete.py +++ b/cards/autocomplete.py @@ -15,10 +15,10 @@ class Autocomplete(object): """ - def __init__(self, query, pretty=None, _format=None): + def __init__(self, query, **kwargs): self.query = query - self.pretty = pretty - self.format = _format + self.pretty = kwargs.get('pretty') + self.format = kwargs.get('format') loop = asyncio.get_event_loop() self.session = aiohttp.ClientSession(loop=loop) diff --git a/cards/randomcard.py b/cards/randomcard.py index 0bdc1ce..ac16cba 100644 --- a/cards/randomcard.py +++ b/cards/randomcard.py @@ -1,8 +1,8 @@ from .scryfall_object import ScryfallObject -class RandomCard(ScryfallObject): +class Random(ScryfallObject): """This will return a random card. No parameters are passed while creating.""" def __init__(self): self.url = 'cards/random' - super(RandomCard, self).__init__(self.url) + super(Random, self).__init__(self.url)