Support some unicode text
This commit is contained in:
parent
ee0da6e0de
commit
352f59288d
1 changed files with 4 additions and 0 deletions
4
mtg.py
4
mtg.py
|
@ -26,6 +26,8 @@ class Mana:
|
||||||
self.mana = result.mana
|
self.mana = result.mana
|
||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
result = Mana()
|
result = Mana()
|
||||||
|
if isinstance(other, unicode):
|
||||||
|
other = str(other)
|
||||||
if isinstance(other, str):
|
if isinstance(other, str):
|
||||||
for m in [c for c in other.upper() if c in Mana.types.keys()]:
|
for m in [c for c in other.upper() if c in Mana.types.keys()]:
|
||||||
result.mana[m] = result.mana[m] + 1
|
result.mana[m] = result.mana[m] + 1
|
||||||
|
@ -77,6 +79,8 @@ class ManaCost:
|
||||||
self.snow = result.snow
|
self.snow = result.snow
|
||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
result = ManaCost()
|
result = ManaCost()
|
||||||
|
if isinstance(other, unicode):
|
||||||
|
other = str(other)
|
||||||
if isinstance(other, str):
|
if isinstance(other, str):
|
||||||
symbols = []
|
symbols = []
|
||||||
hybrid = re.findall(ManaCost.hybridPattern, other)
|
hybrid = re.findall(ManaCost.hybridPattern, other)
|
||||||
|
|
Loading…
Reference in a new issue