Where can I put warn files? And get() vs. put()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Where can I put warn files? And get() vs. put()

Meira, S.
Dear all,
 
I am planning to run interwiki.py (from pywikipedia) on the Volapük wikipedia, but I don't have a place in a server that I could use to store the resulting warnfiles so that other interwiki.py users could have access to them. What should I do? Is there some place somewhere in wikipedia where I could upload the files and then post their address to others? Or is there a mailing list (perhaps this one?) that I could send the (gzipped) warnfiles to?
 
Another question: I'm having problems running little bots on the Volapük wikipedia. For some reason, the python command: page.get()  (to get the text of the page stored in the variable 'page') doesn't work from my GUI (I'm using IDLE). If I put text -- using page.put() -- it works fine; but if I want to retrieve the text I have just uploaded with page.put(), then for some strange reason page.get() won't do it -- I just get a longish error message that apparently says there is no such page. Would anyone be able to help me? Or do you know who I can ask for help, in case this is not the right place?
 
 
Smeira
_______________________________________________
Wikibots-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Where can I put warn files? And get() vs. put()

Andre Engels
2007/5/16, Meira, S. <[hidden email]>:
> I am planning to run interwiki.py (from pywikipedia) on the Volapük wikipedia, but I don't have a place in a server that I could use to store the resulting warnfiles so that other interwiki.py users could have access to them. What should I do? Is there some place somewhere in wikipedia where I could upload the files and then post their address to others? Or is there a mailing list (perhaps this one?) that I could send the (gzipped) warnfiles to?

You could post them on this list, or put them on meta.

> Another question: I'm having problems running little bots on the Volapük wikipedia. For some reason, the python command: page.get()  (to get the text of the page stored in the variable 'page') doesn't work from my GUI (I'm using IDLE). If I put text -- using page.put() -- it works fine; but if I want to retrieve the text I have just uploaded with page.put(), then for some strange reason page.get() won't do it -- I just get a longish error message that apparently says there is no such page. Would anyone be able to help me? Or do you know who I can ask for help, in case this is not the right place?

I would need to know exactly what you type (try to get something as
simple as possible that causes the error), then I can see what goes
wrong.

--
Andre Engels, [hidden email]
ICQ: 6260644  --  Skype: a_engels
_______________________________________________
Wikibots-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Where can I put warn files? And get() vs. put()

Daniel Herding
In reply to this post by Meira, S.
On Wednesday 16 May 2007 11:53:38 Meira, S. wrote:

> I am planning to run interwiki.py (from pywikipedia) on the Volapük
> wikipedia, but I don't have a place in a server that I could use to store
> the resulting warnfiles so that other interwiki.py users could have access
> to them. What should I do?

There are several free upload services, I think http://www.speedyshare.com/ 
supports archive files.

> Is there some place somewhere in wikipedia where
> I could upload the files and then post their address to others? Or is there
> a mailing list (perhaps this one?) that I could send the (gzipped)
> warnfiles to?

You should post it on http://meta.wikimedia.org/wiki/Interwiki_bot/Warnfiles 
and also write to this mailing list (as not many bot operators regularly read
the meta page).


Daniel

_______________________________________________
Wikibots-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Where can I put warn files? And get() vs. put()

Meira, S.
In reply to this post by Andre Engels
Thanks for the quick answers!
 
>You could post them on this list, or put them on meta.
>There are several free upload services, I think http://www.speedyshare.com/ <https://webmail.wsd.leidenuniv.nl/exchweb/bin/redir.asp?URL=http://www.speedyshare.com/>
supports archive files.


Do you mean that I could gzip the files and send them directly to this list? I think they'll be about 2-3MB; is that too much?
Or do you mean I should smply send a message to the list after I run interwiki to tell people there are new warnfiles? (I suppose the easiest solution is to upload them to speedyshare, as Daniel suggested, and just post the address to this list, and also to meta -- I assume you mean the link in the interwiki.py page?

>I would need to know exactly what you type (try to get something as
simple as possible that causes the error), then I can see what goes
wrong.

OK, here is what I just did.
1. I loaded IDLE in my Windows PC (from the Start menu).
 
2. I try to "import wikipedia". IDLE says:
"Traceback (most recent call last):
    File "<pyshell#1>", line 1, in <module>
       import wikipedia
ImportError: No module named wikipedia
 
Apparently it is not looking in the right folder, since it didn't find wikipedia.
 
3. I then loaded wikipedia  (Open from file menu) and ran it with "Run Module" (F5) -- I have very little experience, and this seemed to have the desired effect of pointing IDLE to the right folder. IDLE answered:
"======== RESTART ========
>>>
Checked for running processes. 1 processes currently running, including the current process.
Checked for running processes. 2 processes currently running, inlcuding the current process."
 
4. Now I did "import wikipedia", and it worked.
5. I wrote: site = wikipedia.Site('vo', 'wikipedia'). No error messages; print site yields wikipedia:vo
6. I wrote: pad = wikipedia.Page(site, 'Aalst') (Aalst being an extant page on the Volapük wikipedia).
   No error messages; print pad yields [[Aalst]].
7. Now the problem. I try: txt = pad.get(). It begins well, with:
   Geting page [[Aalst]]
   Checked for running processes. 1 processes currently running, including the current process.
 
   Then, after 5-6 seconds, I get:
"Traceback (most recent call last):
     File "<pyshell#8>", line 1, in <module>
       txt = pad.get()
     File "C:\Sérgio\Python2.5\pywikipedia\wikipedia.py", line 491, in get
       self._contents, self._isWatched, self.editRestriction = self.getEditPage(get_redirect = get_redirect, \
          throttle = throttle, sysop = sysop)
     File "C:\Sérgio\Python2.5\pywikipedia\wikipedia.py", line 584, in getEditPage
          raise NoPage(self.site(), self.aslink(forceInterwiki = True))
NoPage: (wikipedia.vo, u'[[vo:Aalst]]')
>>>.
 
Now, just out of curiosity, I try:
8. pad.put('aaaa'). It says:
 
Geting a page to check if we're logged in on wikipedia:vo
Creating page [[vo:Aalst]]
 
And then, I get an error message:
 
Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    pad.put('aaaa')
  File "C:\Sérgio\Python2.5\pywikipedia\wikipedia.py", line 948, in put
    return self.putPage(newtext, comment, watchArticle, minorEdit, newPage, self.site().getToken(sysop = sysop), sysop = sysop)
  File "C:\Sérgio\Python2.5\pywikipedia\wikipedia.py", line 1039, in putPage
    raise EditConflict(u'An edit conflict has occured.')
EditConflict: An edit conflict has occured.
 
Hmm. I try with a different page:
9. pad2 = wikipedia.Page(site, 'Aaa')  (Aaa is a non-existant page; now print pad2 yields [[Aaa]]).
10. pad2.put('aaaa'). Answer:
 
Getting page [[Aaa]]
Checked for running processes. 1 processes currently running, including the current process.
Creating page [[vo:Aaa]]
(302, 'Moved Temporarily', u' ')
 
When I check the Volapük wikipedia, the page "Aaa" is there, with text "aaaaa". I delete it, since it's nonsensical.
 
So: put() worked, but not get(). Can you help me?
 
Thanks in advance,
 
Sérgio

_______________________________________________
Wikibots-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Where can I put warn files? And get() vs. put()

Andre Engels
Sorry, I am unable to duplicate your problem. I'm not used to your
method of invoking idle, but if I try it my way (open the file for
editing in idle, then typing in in the Python Shell) I get:

>>> import wikipedia
>>> site = wikipedia.Site('vo','wikipedia')
>>> pad = wikipedia.Page(site, 'Aalst')
>>> txt = pad.get()
>>> txt
u"[[Magod:MnpAalstLocation.png|right|200px]]\n'''Aalst''' binon zif in
provin: [[Oost-Vlaanderen]], in [[Belg\xe4n]].\n \n\nS\xfcrfat ela
Aalst binon 78,12 km\xb2.\n\n\nAalst labon bel\xf6danis 77 508
(2006).\n\n\n{{ZifsOostVlaanderenBelg\xe4n}}\n\n[[Category:Zifs]]\n[[Category:Zifs
in Belg\xe4n]]\n\n[[bg:\u0410\u0430\u043b\u0441\u0442]]\n[[cs:Aalst]]\n[[de:Aalst]]\n[[en:Aalst,
Belgium]]\n[[eo:Aalst]]\n[[es:Aalst]]\n[[fi:Aalst]]\n[[fr:Alost]]\n[[gl:Aalst]]\n[[it:Aalst]]\n[[ja:\u30a2\u30fc\u30eb\u30b9\u30c8]]\n[[la:Alostum]]\n[[li:Aals
(gemeinte)]]\n[[nl:Aalst
(Oost-Vlaanderen)]]\n[[no:Aalst]]\n[[pl:Aalst]]\n[[pt:Aalst]]\n[[sk:Aalst]]\n[[sv:Aalst]]"

So it seems to be working without problems for me.

What I do see is that for some reason or another, your bot believes
that the page does not exist. But I can't think of what that reason
might be. Sorry.

Andre

2007/5/16, Meira, S. <[hidden email]>:

> Thanks for the quick answers!
>
> >You could post them on this list, or put them on meta.
> >There are several free upload services, I think http://www.speedyshare.com/ <https://webmail.wsd.leidenuniv.nl/exchweb/bin/redir.asp?URL=http://www.speedyshare.com/>
> supports archive files.
>
>
> Do you mean that I could gzip the files and send them directly to this list? I think they'll be about 2-3MB; is that too much?
> Or do you mean I should smply send a message to the list after I run interwiki to tell people there are new warnfiles? (I suppose the easiest solution is to upload them to speedyshare, as Daniel suggested, and just post the address to this list, and also to meta -- I assume you mean the link in the interwiki.py page?
>
> >I would need to know exactly what you type (try to get something as
> simple as possible that causes the error), then I can see what goes
> wrong.
>
> OK, here is what I just did.
> 1. I loaded IDLE in my Windows PC (from the Start menu).
>
> 2. I try to "import wikipedia". IDLE says:
> "Traceback (most recent call last):
>     File "<pyshell#1>", line 1, in <module>
>        import wikipedia
> ImportError: No module named wikipedia
>
> Apparently it is not looking in the right folder, since it didn't find wikipedia.
>
> 3. I then loaded wikipedia  (Open from file menu) and ran it with "Run Module" (F5) -- I have very little experience, and this seemed to have the desired effect of pointing IDLE to the right folder. IDLE answered:
> "======== RESTART ========
> >>>
> Checked for running processes. 1 processes currently running, including the current process.
> Checked for running processes. 2 processes currently running, inlcuding the current process."
>
> 4. Now I did "import wikipedia", and it worked.
> 5. I wrote: site = wikipedia.Site('vo', 'wikipedia'). No error messages; print site yields wikipedia:vo
> 6. I wrote: pad = wikipedia.Page(site, 'Aalst') (Aalst being an extant page on the Volapük wikipedia).
>    No error messages; print pad yields [[Aalst]].
> 7. Now the problem. I try: txt = pad.get(). It begins well, with:
>    Geting page [[Aalst]]
>    Checked for running processes. 1 processes currently running, including the current process.
>
>    Then, after 5-6 seconds, I get:
> "Traceback (most recent call last):
>      File "<pyshell#8>", line 1, in <module>
>        txt = pad.get()
>      File "C:\Sérgio\Python2.5\pywikipedia\wikipedia.py", line 491, in get
>        self._contents, self._isWatched, self.editRestriction = self.getEditPage(get_redirect = get_redirect, \
>           throttle = throttle, sysop = sysop)
>      File "C:\Sérgio\Python2.5\pywikipedia\wikipedia.py", line 584, in getEditPage
>           raise NoPage(self.site(), self.aslink(forceInterwiki = True))
> NoPage: (wikipedia.vo, u'[[vo:Aalst]]')
> >>>.
>
> Now, just out of curiosity, I try:
> 8. pad.put('aaaa'). It says:
>
> Geting a page to check if we're logged in on wikipedia:vo
> Creating page [[vo:Aalst]]
>
> And then, I get an error message:
>
> Traceback (most recent call last):
>   File "<pyshell#9>", line 1, in <module>
>     pad.put('aaaa')
>   File "C:\Sérgio\Python2.5\pywikipedia\wikipedia.py", line 948, in put
>     return self.putPage(newtext, comment, watchArticle, minorEdit, newPage, self.site().getToken(sysop = sysop), sysop = sysop)
>   File "C:\Sérgio\Python2.5\pywikipedia\wikipedia.py", line 1039, in putPage
>     raise EditConflict(u'An edit conflict has occured.')
> EditConflict: An edit conflict has occured.
>
> Hmm. I try with a different page:
> 9. pad2 = wikipedia.Page(site, 'Aaa')  (Aaa is a non-existant page; now print pad2 yields [[Aaa]]).
> 10. pad2.put('aaaa'). Answer:
>
> Getting page [[Aaa]]
> Checked for running processes. 1 processes currently running, including the current process.
> Creating page [[vo:Aaa]]
> (302, 'Moved Temporarily', u' ')
>
> When I check the Volapük wikipedia, the page "Aaa" is there, with text "aaaaa". I delete it, since it's nonsensical.
>
> So: put() worked, but not get(). Can you help me?
>
> Thanks in advance,
>
> Sérgio
>
> _______________________________________________
> Wikibots-l mailing list
> [hidden email]
> http://lists.wikimedia.org/mailman/listinfo/wikibots-l
>
>


--
Andre Engels, [hidden email]
ICQ: 6260644  --  Skype: a_engels
_______________________________________________
Wikibots-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/wikibots-l