diff options
Diffstat (limited to 'src/fetch/scripts/dark_horse_comics.py')
-rw-r--r-- | src/fetch/scripts/dark_horse_comics.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/fetch/scripts/dark_horse_comics.py b/src/fetch/scripts/dark_horse_comics.py index 4f3b651..0db83ec 100644 --- a/src/fetch/scripts/dark_horse_comics.py +++ b/src/fetch/scripts/dark_horse_comics.py @@ -86,7 +86,7 @@ class BasicTellicoDOM: entryNode.setAttribute('id', str(self.__currentId)) titleNode = self.__doc.createElement('title') - titleNode.appendChild(self.__doc.createTextNode(unicode(d['title'], 'latin-1').encode('utf-8'))) + titleNode.appendChild(self.__doc.createTextNode(tqunicode(d['title'], 'latin-1').encode('utf-8'))) yearNode = self.__doc.createElement('pub_year') yearNode.appendChild(self.__doc.createTextNode(d['pub_year'])) @@ -101,25 +101,25 @@ class BasicTellicoDOM: writersNode = self.__doc.createElement('writers') for g in d['writer']: writerNode = self.__doc.createElement('writer') - writerNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8'))) + writerNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8'))) writersNode.appendChild(writerNode) genresNode = self.__doc.createElement('genres') for g in d['genre']: genreNode = self.__doc.createElement('genre') - genreNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8'))) + genreNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8'))) genresNode.appendChild(genreNode) commentsNode = self.__doc.createElement('comments') #for g in d['comments']: - # commentsNode.appendChild(self.__doc.createTextNode(unicode("%s\n\n" % g, 'latin-1').encode('utf-8'))) + # commentsNode.appendChild(self.__doc.createTextNode(tqunicode("%s\n\n" % g, 'latin-1').encode('utf-8'))) commentsData = string.join(d['comments'], '\n\n') - commentsNode.appendChild(self.__doc.createTextNode(unicode(commentsData, 'latin-1').encode('utf-8'))) + commentsNode.appendChild(self.__doc.createTextNode(tqunicode(commentsData, 'latin-1').encode('utf-8'))) artistsNode = self.__doc.createElement('artists') for k, v in d['artist'].iteritems(): artistNode = self.__doc.createElement('artist') - artistNode.appendChild(self.__doc.createTextNode(unicode(v, 'latin-1').encode('utf-8'))) + artistNode.appendChild(self.__doc.createTextNode(tqunicode(v, 'latin-1').encode('utf-8'))) artistsNode.appendChild(artistNode) pagesNode = self.__doc.createElement('pages') @@ -132,7 +132,7 @@ class BasicTellicoDOM: imageNode = self.__doc.createElement('image') imageNode.setAttribute('format', 'JPEG') imageNode.setAttribute('id', d['image'][0]) - imageNode.appendChild(self.__doc.createTextNode(unicode(d['image'][1], 'latin-1').encode('utf-8'))) + imageNode.appendChild(self.__doc.createTextNode(tqunicode(d['image'][1], 'latin-1').encode('utf-8'))) coverNode = self.__doc.createElement('cover') coverNode.appendChild(self.__doc.createTextNode(d['image'][0])) @@ -220,7 +220,7 @@ class DarkHorseParser: Retrieve all links related to the search. self.__data contains HTML content fetched by self.__getHTMLContent() that need to be parsed. """ - matchList = re.findall("""<a *href="%s(?P<page>.*?)">(?P<title>.*?)</a>""" % self.__basePath.replace('?', '\?'), self.__data) + matchList = re.findall("""<a *href="%s(?P<page>.*?)">(?P<title>.*?)</a>""" % self.__basePath.tqreplace('?', '\?'), self.__data) if not matchList: return None return matchList |