summaryrefslogtreecommitdiffstats
path: root/src/fetch/scripts
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/fetch/scripts
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/fetch/scripts')
-rw-r--r--src/fetch/scripts/dark_horse_comics.py16
-rwxr-xr-xsrc/fetch/scripts/fr.allocine.py24
-rw-r--r--src/fetch/scripts/ministerio_de_cultura.py10
3 files changed, 25 insertions, 25 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
diff --git a/src/fetch/scripts/fr.allocine.py b/src/fetch/scripts/fr.allocine.py
index 97a2247..6412ecf 100755
--- a/src/fetch/scripts/fr.allocine.py
+++ b/src/fetch/scripts/fr.allocine.py
@@ -90,23 +90,23 @@ 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')))
otitleNode = self.__doc.createElement('titre-original')
- otitleNode.appendChild(self.__doc.createTextNode(unicode(d['otitle'], 'latin-1').encode('utf-8')))
+ otitleNode.appendChild(self.__doc.createTextNode(tqunicode(d['otitle'], 'latin-1').encode('utf-8')))
yearNode = self.__doc.createElement('year')
- yearNode.appendChild(self.__doc.createTextNode(unicode(d['year'], 'latin-1').encode('utf-8')))
+ yearNode.appendChild(self.__doc.createTextNode(tqunicode(d['year'], 'latin-1').encode('utf-8')))
genresNode = self.__doc.createElement('genres')
for g in d['genres']:
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)
natsNode = self.__doc.createElement('nationalitys')
natNode = self.__doc.createElement('nat')
- natNode.appendChild(self.__doc.createTextNode(unicode(d['nat'], 'latin-1').encode('utf-8')))
+ natNode.appendChild(self.__doc.createTextNode(tqunicode(d['nat'], 'latin-1').encode('utf-8')))
natsNode.appendChild(natNode)
castsNode = self.__doc.createElement('casts')
@@ -114,7 +114,7 @@ class BasicTellicoDOM:
castNode = self.__doc.createElement('cast')
col1Node = self.__doc.createElement('column')
col2Node = self.__doc.createElement('column')
- col1Node.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8')))
+ col1Node.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8')))
castNode.appendChild(col1Node)
castNode.appendChild(col2Node)
castsNode.appendChild(castNode)
@@ -122,17 +122,17 @@ class BasicTellicoDOM:
dirsNode = self.__doc.createElement('directors')
for g in d['dirs']:
dirNode = self.__doc.createElement('director')
- dirNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8')))
+ dirNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8')))
dirsNode.appendChild(dirNode)
timeNode = self.__doc.createElement('running-time')
- timeNode.appendChild(self.__doc.createTextNode(unicode(d['time'], 'latin-1').encode('utf-8')))
+ timeNode.appendChild(self.__doc.createTextNode(tqunicode(d['time'], 'latin-1').encode('utf-8')))
- allocineNode = self.__doc.createElement(unicode('allocin�-link', 'latin-1').encode('utf-8'))
- allocineNode.appendChild(self.__doc.createTextNode(unicode(d['allocine'], 'latin-1').encode('utf-8')))
+ allocineNode = self.__doc.createElement(tqunicode('allocin�-link', 'latin-1').encode('utf-8'))
+ allocineNode.appendChild(self.__doc.createTextNode(tqunicode(d['allocine'], 'latin-1').encode('utf-8')))
plotNode = self.__doc.createElement('plot')
- plotNode.appendChild(self.__doc.createTextNode(unicode(d['plot'], 'latin-1').encode('utf-8')))
+ plotNode.appendChild(self.__doc.createTextNode(tqunicode(d['plot'], 'latin-1').encode('utf-8')))
if d['image']:
imageNode = self.__doc.createElement('image')
@@ -140,7 +140,7 @@ class BasicTellicoDOM:
imageNode.setAttribute('id', d['image'][0])
imageNode.setAttribute('width', '120')
imageNode.setAttribute('height', '160')
- 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]))
diff --git a/src/fetch/scripts/ministerio_de_cultura.py b/src/fetch/scripts/ministerio_de_cultura.py
index 8a768f9..cdbb580 100644
--- a/src/fetch/scripts/ministerio_de_cultura.py
+++ b/src/fetch/scripts/ministerio_de_cultura.py
@@ -53,7 +53,7 @@ SVN Version:
* Removed "Collection" field as I moved to Series/Series Number
Version 0.3.2:
- * Now find 'notas' field related information
+ * Now tqfind 'notas' field related information
* search URL modified to fetch information of exhausted books too
Version 0.3.1:
@@ -155,9 +155,9 @@ class BasicTellicoDOM:
# Convert all strings to UTF-8
for i in d.keys():
if type(d[i]) == types.ListType:
- d[i] = [unicode(d[i][j], 'latin-1').encode('utf-8') for j in range(len(d[i]))]
+ d[i] = [tqunicode(d[i][j], 'latin-1').encode('utf-8') for j in range(len(d[i]))]
elif type(d[i]) == types.StringType:
- d[i] = unicode(d[i], 'latin-1').encode('utf-8')
+ d[i] = tqunicode(d[i], 'latin-1').encode('utf-8')
entryNode = self.__doc.createElement('entry')
entryNode.setAttribute('id', str(self.__currentId))
@@ -281,7 +281,7 @@ class MinisterioCulturaParser:
# Strip out hyphens if kind is ISBN
if kind == ISBN:
- criteria = criteria.replace('-', NULLSTRING)
+ criteria = criteria.tqreplace('-', NULLSTRING)
# Support for multiple search
isbnList = criteria.split(';')
for n in isbnList:
@@ -502,7 +502,7 @@ Tellico cannot connect to: http://www.mcu.es/comun/bases/isbn/ISBN.htm webpage:
# Now retrieve infos
if links:
for entry in links:
- data = self.__fetchBookInfo( url = self.__baseURL + entry.replace(' ', '%20') )
+ data = self.__fetchBookInfo( url = self.__baseURL + entry.tqreplace(' ', '%20') )
node = self.__domTree.addEntry(data)
else:
return None