Support some unicode text

This commit is contained in:
Correl Roush 2010-09-21 20:16:47 -04:00
parent ee0da6e0de
commit 352f59288d

4
mtg.py
View file

@ -26,6 +26,8 @@ class Mana:
self.mana = result.mana
def __add__(self, other):
result = Mana()
if isinstance(other, unicode):
other = str(other)
if isinstance(other, str):
for m in [c for c in other.upper() if c in Mana.types.keys()]:
result.mana[m] = result.mana[m] + 1
@ -77,6 +79,8 @@ class ManaCost:
self.snow = result.snow
def __add__(self, other):
result = ManaCost()
if isinstance(other, unicode):
other = str(other)
if isinstance(other, str):
symbols = []
hybrid = re.findall(ManaCost.hybridPattern, other)