Things go worse and worse in the last days. First SVN errors, then
change of textlib.py killed my script, and the newest, when running
replace.py:
WARNING: Download package "patch.exe" from
http://downloads.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9…
What is this? Why should I download it? Why did my bot stop, when it
worked normally a few days ago? What did I harm to the world?
--
Bináris
As shown in you version.py your working copy is outdated. You need r11719 or newer which solves the outboundlocalerror.
Greetings
Xqt
----- Ursprüngliche Nachricht -----
Von: Bináris
Gesendet: 09.07.2013 00:09
An: Pywikipedia discussion list
Betreff: Re: [Pywikipedia-l] Patch.exe, what sort of message is this?
I forgot the detailes:
c:\Pywikipedia>replace.py -search
WARNING: Download package "patch.exe" from
http://downloads.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9…
-bin.zip
WARNING: Size of download: 126248 byte(s)
WARNING: MIME type: ['application', 'x-zip-compressed']
WARNING: Extract package "patch.exe" to C:\Pywikipedia\externals\patch.exe.
Traceback (most recent call last):
File "C:\Pywikipedia\replace.py", line 171, in <module>
import wikipedia as pywikibot
File "C:\Pywikipedia\wikipedia.py", line 149, in <module>
import externals # allow imports from externals
File "C:\Pywikipedia\externals\__init__.py", line 387, in <module>
check_setup('patch.exe')
File "C:\Pywikipedia\externals\__init__.py", line 372, in check_setup
if download_install(modules_needed[m][1], m, path):
File "C:\Pywikipedia\externals\__init__.py", line 315, in download_install
arch.extractall(os.path.join(path, '__setup_tmp/'))
UnboundLocalError: local variable 'arch' referenced before assignment
Output of version.py:
c:\Pywikipedia>version.py
WARNING: Download package "patch.exe" from
http://downloads.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9…
-bin.zip
WARNING: Size of download: 126248 byte(s)
WARNING: MIME type: ['application', 'x-zip-compressed']
WARNING: Extract package "patch.exe" to C:\Pywikipedia\externals\patch.exe.
local variable 'arch' referenced before assignment
Serious import error; pywikibot not available - was it configured?
Pywikipedia trunk/pywikipedia/ (r11712, 2013/07/05, 01:17:44, OUTDATED)
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Hi,
I've started to work with wikidata few days ago and have found out, that in
rewrite branch ItemPage.fromPage haven't worked properly, so I had started
digging in code and made small patch, which should resolve this issue.
The code is available here:
https://github.com/magul/pywikibot-core/tree/ItemPageFromPage
Could be it merged to rewrite branch? What should I do to make it happen?
Thanks for answer in advance
--
Tomasz Magulski
Hello,
if you use PWB with Wikidata you need often some functions not yet
provided by the framework. Here are some functions which I miss:
* for the Wikidata Family class
o get a Site object for a given code like 'enwiki'
o Site object to code
o add the items used for the 'imported from' statement directly to
the file, because retrieving them always from online (
www.wikidata.org/wiki/Wikidata:List_of_wikis/python ) is very
unusual
* Site creation function: Return a DataSite object if Wikidata is
requested. Sometimes you need a DataSite object directly, you can
use pywikibot.site.DataSite, but this is not really nice.
I would help coding the feautures but I have no access to SVN and I
don't now if it is useful to request it now because PWB will move to Git
soon.
Greetings
Pyfisch
Hi all,
I had mentioned this in the rewrite roadmap, and noticed it came up on IRC
as well, so I'd like to run this by the mailing list:
User:The Earwig has written a pure-python (with optional C-speedups)
MediaWiki text parser named mwparserfromhell[1]. Currently we have the
textlib library and some various regexes that implement this in a
non-perfect way. From my experience using mwparser (over 400k successful
edits with no issues) I believe it is ready to be bundled with the
framework. I think it would still be a good idea to keep textlib in as a
fallback or for users who are currently using it and don't need to migrate.
As for actually adding it, in the rewrite branch we can just add it as a
dependency in setup.py, and then convert various methods over.
In trunk, I'm guessing we would need to add it as an external. (I'm not
sure how that's actually done.)
[1] https://github.com/earwig/mwparserfromhell
-- Legoktm
Hi Binaris,
I was investigating in that issue again and found a wrong order for the re.escape() sequence. This caused some errors in past with blanks and underlines in the section headers. I fixed it in r11755/r11756. Could you please validate it for your script.
Thanks and sorry for trouble
xqt
----- Original Nachricht ----
Von: Bináris <wikiposta(a)gmail.com>
An: Pywikipedia discussion list <pywikipedia-l(a)lists.wikimedia.org>
Datum: 06.07.2013 00:16
Betreff: [Pywikipedia-l] Script halted, textlib.py?
> Hi, this is a message from the server running masvita.py.
> The only change in code since the last successful run is here:
> http://hu.wikipedia.org/w/index.php?title=Szerkeszt%C5%91:BinBot/masvita.py&
> diff=prev&oldid=13723804
> This is also the source of my script.
> The error message is below and it mentions textlib.py at the end. Has
> anything changed? I can't imagine how my above modification in the quoted
> text could cause the crash.
>
>
> ---------- Forwarded message ----------
> From: Cron Daemon <root(a)tron.wmm.hu>
> Date: 2013/7/2
> Subject: Cron <binaris@tron> bash weekofmonth 1 python
> pywikipedia/masvita.py > /dev/null
> To: wikiposta+tron(a)gmail.com
>
>
> No handlers could be found for logger "pywiki"
> NOTE: You have new messages on wikipedia:hu
>
> Getting references to [[Sablon:Másvita]] via API...
>
> Reading section info from [[Wikipédia:Kocsmafal (egyéb)/Archív53]] via
> API...
>
> A pywikipedia/masvita.py 09:02-kor megszakadt.
> A feldolgozás során mentési hiba nem történt.
>
>
> Email sent.
>
> Traceback (most recent call last):
> File "pywikipedia/masvita.py", line 279, in <module>
> main()
> File "pywikipedia/masvita.py", line 273, in main
> bot.run()
> File "pywikipedia/masvita.py", line 208, in run
> comment += self.commenttext(self.found(archtitle), False)
> File "pywikipedia/masvita.py", line 134, in found
> section.get()
> File "/home/binaris/pywikipedia/wikipedia.py", line 741, in get
> expandtemplates = expandtemplates)
> File "/home/binaris/pywikipedia/wikipedia.py", line 881, in _getEditPage
> not does_text_contain_section(pagetext, self.section()):
> File "/home/binaris/pywikipedia/pywikibot/textlib.py", line 1078, in
> does_text_contain_section
> m = re.search("=+[ ']*%s[ ']*=+" % section, pagetext)
> File "/usr/lib/python2.7/re.py", line 142, in search
> return _compile(pattern, flags).search(string)
> File "/usr/lib/python2.7/re.py", line 244, in _compile
> raise error, v # invalid expression
> sre_constants.error: multiple repeat
>
>
>
> --
> Bináris
>
>
> --------------------------------
>
> _______________________________________________
> Pywikipedia-l mailing list
> Pywikipedia-l(a)lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>
textlib: as I answered last week I found that the method did not properly in past. Unfortunately it did not match some Unicode strings. Now it does but you have to escape regex signs by yourself. On the other hand you are able to use a full regex and could search for wiki links in the section header. Feel free to revert my release and find another solution for unicode signs an we link brackets in the header.
patch.exe: There is a thread at code revision r11711. I am unhappy with running .exe files but maybe it is needed sometimes to patch externals for the framework. I am really unsure and prefer using derived classes and methods.
Best
Xqt
----- Ursprüngliche Nachricht -----
Von: Bináris
Gesendet: 09.07.2013 00:07
An: Pywikipedia discussion list
Betreff: [Pywikipedia-l] Patch.exe, what sort of message is this?
Things go worse and worse in the last days. First SVN errors, then
change of textlib.py killed my script, and the newest, when running
replace.py:
WARNING: Download package "patch.exe" from
http://downloads.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9…
What is this? Why should I download it? Why did my bot stop, when it
worked normally a few days ago? What did I harm to the world?
--
Bináris
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Hi,
I am Chinmay, a Gsoc intern working on GeneBot. The bot will capture fields
of Protein Box Templates onto wikidata. I am using pywikipedia-rewrite
branch to query wikidata.
Using the framework i can access wikidata items through their
identifiers(Reelin item -- Q414043) or through the default linked wikidata
item to the Wikipedia page.
For some properties(ex GenLoc assembly) the value type is ITEM.I am stuck
on keeping track of wikidata items.
Is there any other mechanism to obtain wikidata items? ex : search by
title? , property based retreival ?
The bot code is hosted here -- [
https://bitbucket.org/chinmay26/genebot/wiki/Home]. Any suggestions are
welcome.
Regards,
Chinmay
Hi,
I am Chinmay, a GSOC intern at Crowdbio (
http://www.google-melange.com/gsoc/project/google/gsoc2013/chinmay26/24001).
Our goal is to create a bot to capture gene info in PBB templates (
http://en.wikipedia.org/wiki/Category:Human_protein_templates) onto
wikidata. We will be using Pywikipedia-bot framework. I am confused whether
to go with Trunk or Rewrite branch. I am familiar with the Trunk and have
queried wikidata items using it. On the other hand, there seems to be less
documentation for Rewrite branch. I have installed the Rewrite as package
from latest nightly release but not too familiar with it.
For our bot, we will be having normal functions like creating/updating
items, claims, sources etc.(the Trunk seems sufficient for these
functions). I have started coding with the Trunk but now i am a bit
concerned about the lifetime about Trunk branch. Any chances it may be get
outdated and then i would have to port to Release??
I am also concerned about the pace of development of the Rewrite branch.
>From another thread, I have noticed about changes to editEntity() to create
items etc...
Should i use the Trunk or Rewrite branch ??
Regards,
Chinmay