From 30b03a363066df715e10e7d242e001fde987298e Mon Sep 17 00:00:00 2001 From: Nanda Scott Date: Fri, 9 Feb 2018 17:46:42 -0500 Subject: [PATCH] Fixed a bug by changing all kwargs to default to None --- scrython/cards/autocomplete.py | 4 ++-- scrython/cards/cards_object.py | 8 ++++---- scrython/cards/named.py | 2 +- scrython/rulings/rulings_object.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scrython/cards/autocomplete.py b/scrython/cards/autocomplete.py index 05d6e82..9a86310 100644 --- a/scrython/cards/autocomplete.py +++ b/scrython/cards/autocomplete.py @@ -3,8 +3,8 @@ import asyncio, aiohttp class Autocomplete(object): def __init__(self, query, **kwargs): self.query = query - self.pretty = kwargs.get('pretty') - self.format = kwargs.get('format') + self.pretty = kwargs.get('pretty', 'None') + self.format = kwargs.get('format', 'None') loop = asyncio.get_event_loop() self.session = aiohttp.ClientSession(loop=loop) diff --git a/scrython/cards/cards_object.py b/scrython/cards/cards_object.py index bfd53aa..4a4f5d2 100644 --- a/scrython/cards/cards_object.py +++ b/scrython/cards/cards_object.py @@ -14,10 +14,10 @@ class CardsObject(object): self.scryfallJson = loop.run_until_complete(getRequest( url = self._url, params={ - 'format': kwargs.get('format'), - 'face': kwargs.get('face'), - 'version': kwargs.get('version'), - 'pretty': kwargs.get('pretty') + 'format': kwargs.get('format', 'None'), + 'face': kwargs.get('face', 'None'), + 'version': kwargs.get('version', 'None'), + 'pretty': kwargs.get('pretty', 'None') })) if self.scryfallJson['object'] == 'error': diff --git a/scrython/cards/named.py b/scrython/cards/named.py index be3696f..26436cf 100644 --- a/scrython/cards/named.py +++ b/scrython/cards/named.py @@ -5,7 +5,7 @@ class Named(CardsObject): def __init__(self, **kwargs): self.exact = kwargs.get('exact') self.fuzzy = kwargs.get('fuzzy') - self.set = kwargs.get('set') + self.set = kwargs.get('set', 'None') self.dict = {} if self.exact is not None: diff --git a/scrython/rulings/rulings_object.py b/scrython/rulings/rulings_object.py index dd433cc..9933b4e 100644 --- a/scrython/rulings/rulings_object.py +++ b/scrython/rulings/rulings_object.py @@ -3,8 +3,8 @@ import aiohttp class RulingsObject(object): def __init__(self, _url, **kwargs): - self.pretty = kwargs.get('pretty') - self.format = kwargs.get('format') + self.pretty = kwargs.get('pretty', 'None') + self.format = kwargs.get('format', 'None') self._url = 'https://api.scryfall.com/' + _url loop = asyncio.get_event_loop() self.session = aiohttp.ClientSession(loop=loop)