[Pywikipedia-l] SVN: [5939] trunk/pywikipedia/welcome.py

filnik at svn.wikimedia.org filnik at svn.wikimedia.org
Tue Oct 7 16:45:32 UTC 2008


Revision: 5939
Author:   filnik
Date:     2008-10-07 16:45:31 +0000 (Tue, 07 Oct 2008)

Log Message:
-----------
Fixing the right path where to save the savedata, in order not to save the file outside the right foulder

Modified Paths:
--------------
    trunk/pywikipedia/welcome.py

Modified: trunk/pywikipedia/welcome.py
===================================================================
--- trunk/pywikipedia/welcome.py	2008-10-07 14:45:46 UTC (rev 5938)
+++ trunk/pywikipedia/welcome.py	2008-10-07 16:45:31 UTC (rev 5939)
@@ -653,7 +653,8 @@
                 numberlog = int(arg[11:])
     # TODO: Maybe it's better change the tuple with a dictionary..
     wsite = wikipedia.getSite()
-    filename = 'welcome-%s-%s.data' % (wsite.family.name, wsite.lang)  # file where is stored the random signature index
+    # Filename and pywikipedia path
+    filename = wikipedia.config.datafilepath('welcome-%s-%s.data' % (wsite.family.name, wsite.lang))  # file where is stored the random signature index
     if offset_variable and timeoffset_variable:
         wikipedia.output('WARING: both -offset and -timeoffset were provided, ignoring -offset')
         offset_variable = 0
@@ -722,8 +723,7 @@
         welcomer = u'{{subst:Benvenuto}} %s'
 
     welcomed_users = list()
-    if savedata and os.path.exists(
-                                wikipedia.config.datafilepath(filename)):
+    if savedata and os.path.exists(filename):
         f = file(filename)
         number_user = cPickle.load(f)
         yield number_user
@@ -971,6 +971,7 @@
         # If recursive, just wait some error or something to get the number
         # and save it, otherwise just save the first one.
         for number_user in main(settingsBot):
+            #print number_user
             pass # number_user get with the for cicle the value
         #except wikipedia.BadTitle:
             # If the server is down, pywikipediabot raise that error.





More information about the Pywikipedia-l mailing list