Fixed a bug by changing all kwargs to default to None

This commit is contained in:
Nanda Scott 2018-02-09 17:46:42 -05:00
parent eee66d4826
commit 30b03a3630
4 changed files with 9 additions and 9 deletions

View File

@ -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)

View File

@ -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':

View File

@ -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:

View File

@ -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)