Added support for multilingual stuff.
This commit is contained in:
parent
b9ca5393c6
commit
cf5d1f94f9
|
@ -6,6 +6,9 @@ New stuff
|
||||||
|
|
||||||
- Arena IDs are now accessible from all `cards` objects with `arena_id()`.
|
- Arena IDs are now accessible from all `cards` objects with `arena_id()`.
|
||||||
- The `lang` attribute is now accessible from all `cards` objects with `lang()`
|
- The `lang` attribute is now accessible from all `cards` objects with `lang()`
|
||||||
|
- `printed_name()`, `printed_type_line()`, `printed_text()` have been added to all `card`
|
||||||
|
objects.
|
||||||
|
- `lang` optional argument has now been added to `Collector()` object. Defaults to `en`
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
|
|
||||||
|
|
|
@ -392,4 +392,19 @@ class CardsObject(object):
|
||||||
def lang(self):
|
def lang(self):
|
||||||
self._checkForKey('lang')
|
self._checkForKey('lang')
|
||||||
|
|
||||||
return self.scryfallJson['lang']
|
return self.scryfallJson['lang']
|
||||||
|
|
||||||
|
def printed_name(self):
|
||||||
|
self._checkForKey('printed_name')
|
||||||
|
|
||||||
|
return self.scryfallJson['printed_name']
|
||||||
|
|
||||||
|
def printed_type_line(self):
|
||||||
|
self._checkForKey('printed_type_line')
|
||||||
|
|
||||||
|
return self.scryfallJson['printed_type_line']
|
||||||
|
|
||||||
|
def printed_text(self):
|
||||||
|
self._checkForKey('printed_text')
|
||||||
|
|
||||||
|
return self.scryfallJson['printed_text']
|
|
@ -12,6 +12,8 @@ class Collector(CardsObject):
|
||||||
Optional arguments:
|
Optional arguments:
|
||||||
Inherits all arguments from CardsObject
|
Inherits all arguments from CardsObject
|
||||||
|
|
||||||
|
lang : str ............................... A 2-3 character language code
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
Inherits all attributes from CardsObject
|
Inherits all attributes from CardsObject
|
||||||
|
|
||||||
|
@ -23,5 +25,9 @@ class Collector(CardsObject):
|
||||||
if kwargs.get('code') is None:
|
if kwargs.get('code') is None:
|
||||||
raise TypeError('No code provided to search by')
|
raise TypeError('No code provided to search by')
|
||||||
|
|
||||||
self.url = 'cards/{}/{}?'.format(kwargs.get('code'), str(kwargs.get('collector_number')))
|
self.url = 'cards/{}/{}/{}?'.format(
|
||||||
|
kwargs.get('code'),
|
||||||
|
str(kwargs.get('collector_number')),
|
||||||
|
kwargs.get('lang', 'en')
|
||||||
|
)
|
||||||
super(Collector, self).__init__(self.url)
|
super(Collector, self).__init__(self.url)
|
||||||
|
|
Loading…
Reference in New Issue