[Pywikipedia-l] SVN: [5374] trunk/pywikipedia

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Wed May 14 19:46:59 UTC 2008


Revision: 5374
Author:   nicdumz
Date:     2008-05-14 19:46:59 +0000 (Wed, 14 May 2008)

Log Message:
-----------
Localizing noreferences.py y for es:

Modified Paths:
--------------
    trunk/pywikipedia/noreferences.py
    trunk/pywikipedia/rciw.py
    trunk/pywikipedia/reflinks.py

Modified: trunk/pywikipedia/noreferences.py
===================================================================
--- trunk/pywikipedia/noreferences.py	2008-05-14 17:13:31 UTC (rev 5373)
+++ trunk/pywikipedia/noreferences.py	2008-05-14 19:46:59 UTC (rev 5374)
@@ -81,6 +81,11 @@
         u'See also',
         u'Notes'
     ],
+    'es': [
+        u'Enlaces externos',
+        u'Véase también',
+        u'Notas',
+    ],
     'fr': [
         u'Liens externes',
         u'Voir aussi',
@@ -136,6 +141,10 @@
         u'Footnotes',
         u'Notes',
     ],
+    'es': [
+        u'Referencias',
+        u'Notas',
+    ],
     'fr': [
         u'Références',
         u'References',
@@ -195,6 +204,7 @@
         'en': [u'Reflist',u'Refs',u'FootnotesSmall',u'Reference',
                u'Ref-list',u'Reference list',u'References-small',u'Reflink',
                u'Footnotes',u'FootnotesSmall'],
+        'es': ['Listaref', 'Reflist'],
         'fr': [u'Références',u'Notes', u'References', u'Reflist'],
         'hu': [u'reflist'],
         'ja': [u'Reflist'],

Modified: trunk/pywikipedia/rciw.py
===================================================================
--- trunk/pywikipedia/rciw.py	2008-05-14 17:13:31 UTC (rev 5373)
+++ trunk/pywikipedia/rciw.py	2008-05-14 19:46:59 UTC (rev 5374)
@@ -63,6 +63,7 @@
             # the Queue has for now an (theoric) unlimited size,
             # it is a simple atomic append(), no need to acquire a semaphore
             self.queue.put_nowait(page)
+            print self.queue.qsize()
 
     def on_dccmsg(self, c, e):
 	pass
@@ -85,7 +86,7 @@
         bot.start()
     except:
         # Quit IRC
-        bot.stop()
+        bot.disconnect()
         # Join the IW threads
         bot.join()
         raise

Modified: trunk/pywikipedia/reflinks.py
===================================================================
--- trunk/pywikipedia/reflinks.py	2008-05-14 17:13:31 UTC (rev 5373)
+++ trunk/pywikipedia/reflinks.py	2008-05-14 19:46:59 UTC (rev 5374)
@@ -52,18 +52,21 @@
         'de':u'Bot: Korrektes Referenzformat (siehe [[:en:User:DumZiBoT/refLinks]])',
         'hu':u'Robot: Forráshivatkozások kibővítése a hivatkozott oldal címével',
         'ko':u'봇: url만 있는 주석을 보강, (영문)[[:en:User:DumZiBoT/refLinks]] 참조',
+        'es':u'Formateando las referencias que no tuvieran titulos (Pruebas por [[Wikipedia:Bot/Autorizaciones#DumZiBoT]] )',
         'en':u'Bot: Converting bare references, see [[User:DumZiBoT/refLinks|FAQ]]'}
 
-deadLinkTag = {'fr':u'{{lien mort}}',
+deadLinkTag = {'fr':u'%s {{lien mort}}',
                'de':u'',
-               'hu':u'{{halott link}}',
-               'ko':u'{{죽은 바깥 고리}}',
-               'en':u'{{dead link}}'}
+               'hu':u'%s {{halott link}}',
+               'ko':u'%s {{죽은 바깥 고리}}',
+               'es':u'{{enlace roto2|%s}}',
+               'en':u'%s {{dead link}}'}
 
 comment = {'fr':u'Titre généré automatiquement',
            'de':u'Automatisch generierter titel',
            'hu':u'Robot generálta cím',
            'ko':u'봇이 따온 제목',
+           'es':u'Título generado por un bot',
            'en':u'Bot generated title'}
 
 soft404 = re.compile(ur'\D404(\D|\Z)|error|errdoc|Not.{0,3}Found|sitedown|eventlog', re.IGNORECASE)
@@ -149,8 +152,8 @@
         return '<ref%s>%s</ref>' % (self.refname, self.link)
     
     def refDead(self):
-        tag = wikipedia.translate(self.site, deadLinkTag)
-        return '<ref%s>[%s]%s</ref>' % (self.refname, self.link, tag)
+        tag = wikipedia.translate(self.site, deadLinkTag) % self.link
+        return '<ref%s>%s</ref>' % (self.refname, tag)
 
     def transform(self, ispdf = False):
         #convert html entities
@@ -202,8 +205,13 @@
         self.ignorepdf = ignorepdf
         self.site = wikipedia.getSite()
         self.stopPage = wikipedia.translate(self.site, stopPage)
-        self.stopPageRevId = wikipedia.Page(self.site, 
-                                            self.stopPage).latestRevision()
+        try :
+            self.stopPageRevId = wikipedia.Page(self.site, 
+                                                self.stopPage).latestRevision()
+        except wikipedia.NoPage :
+            wikipedia.output(u'The stop page %s does not exist' 
+                                % self.stopPage.aslink())
+            wikipedia.stopme()
         self.META_CONTENT = re.compile(ur'(?i)<meta[^>]*content\-type[^>]*>')
         self.CHARSET = re.compile(ur'(?i)charset\s*=\s*(?P<enc>[^\'";>/]*)')
         self.TITLE = re.compile(ur'(?is)(?<=<title>).*?(?=</title>)')





More information about the Pywikipedia-l mailing list