Make sure text is a string

git-svn-id: http://comictagger.googlecode.com/svn/trunk@230 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
beville@gmail.com 2012-12-06 20:30:55 +00:00
parent c5f1542874
commit d3ea8d1b2c

View File

@ -33,14 +33,13 @@ import re
class IssueString:
def __init__(self, text):
self.text = text
self.text = str(text)
#strip out non float-y stuff
tmp_num_str = re.sub('[^0-9.-]',"", text )
tmp_num_str = re.sub('[^0-9.-]',"", self.text )
if tmp_num_str == "":
self.num = None
self.suffix = text
self.suffix = self.text
else:
if tmp_num_str.count(".") > 1:
@ -51,7 +50,7 @@ class IssueString:
self.num = float( tmp_num_str )
self.suffix = ""
parts = text.split(tmp_num_str)
parts = self.text.split(tmp_num_str)
if len( parts ) > 1 :
self.suffix = parts[1]