Fixed a bug by changing all kwargs to default to None
This commit is contained in:
parent
eee66d4826
commit
30b03a3630
|
@ -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)
|
||||
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue