[Pywikipedia-l] PLEASE READ: rewrite branch needs testing

Nicolas Dumazet nicdumz at gmail.com
Fri Feb 20 06:43:46 UTC 2009


Let's spend some time using this brand new framework. We have no
excuses now that replace.py has been ported =)


I'm currently making "as if" I never installed nor used the branch.

I'm trying to set up everything on a clean ubuntu box, to try to run
the yu-tld fix.

-----

# One thing which has to be mentioned is that you have to include the
path where you have checked out the branch in your PYTHONPATH so
python can find the pywikibot module (makes sense, but it's not usual,
for the devs/users of the old framework).

Aka, if you check-out svn checkout
svn+ssh://[yournamehere]@svn.wikimedia.org/svnroot/pywikipedia/branches/rewrite
api-rewrite
you have to include the "api-rewrite" directory in your pythonpath.

For reference, my .bashrc line looks like :
export PYTHONPATH=$PYTHONPATH:/home/nicdumz/opensource/api-rewrite/pywikibot/scripts:/home/nicdumz/opensource/api-rewrite

-----

# I think that you might want to clarify that .pywikibot is supposed
to be a directory: here, I first created a .pywikibot FILE containing
all the info. .pywikibot/ is a directory, containing a user-config.py
file

-----

# I was about to rant about the non-easy installation of dependencies
(aka moving rewrite/simplejson/simplejson to rewrite/simplejson in SVN
would directly include the module in python path, no install
needed...) but I forgot that we're writing a full package here that
will check for dependencies. So for now, manual install of
dependencies, okay.

-----

# I don't understand the strange behavior that is happening when
directly running python from the pywikibot module directory :
~/opensource/api-rewrite/pywikibot$ python pagegenerators.py -weblink:*.yu
'import site' failed; use -v for traceback
No handlers could be found for logger "wiki.config2"
Traceback (most recent call last):
  File "pagegenerators.py", line 21, in <module>
    import pywikibot
  File "/home/nicdumz/opensource/api-rewrite/pywikibot/__init__.py",
line 102, in <module>
    from page import Page, ImagePage, Category, Link
  File "/home/nicdumz/opensource/api-rewrite/pywikibot/page.py", line
15, in <module>
    import pywikibot.site
  File "/home/nicdumz/opensource/api-rewrite/pywikibot/site.py", line
17, in <module>
    from pywikibot.data import api
  File "/home/nicdumz/opensource/api-rewrite/pywikibot/data/api.py",
line 14, in <module>
    import simplejson as json
ImportError: No module named simplejson

~/opensource/api-rewrite/pywikibot$ easy_install simplejson
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

it seems that any python application running in the directory fails to
do imports properly.... any idea ?

-----

# After a few fixes (yeehee), I ran into troubles that I wasn't able
to fix by myself. Two new "rewrite" bugs, yay !


Thanks Russell =)

2009/2/6 Russell Blau <russblau at imapmail.org>:
> The following bots have now been ported to the rewrite framework:
>
> category.py
> editarticle.py
> replace.py
> solve_disambiguation.py
> touch.py
>
> These scripts need testing!  Please report any bugs on the sourceforge.net
> tracker, using the "Rewrite" category.  [One known issue:  "category.py
> move" won't work without the -inplace option.]
>
> You can get the rewrite branch with your favorite SVN client:
>
> svn checkout
> svn+ssh://[yournamehere]@svn.wikimedia.org/svnroot/pywikipedia/branches/rewrite
>
> You will need to make a copy of your existing user-config.py file and store
> it in a new location.  For Windows, this is "C:\Documents and
> Settings\[yournamehere]\Application Data\pywikibot" -- for Unix-like
> systems, it is "~/.pywikibot"  (if you want to put it somewhere
> else, you can set the environment variable PYWIKIBOT2_DIR to the name of the
> directory containing your user-config.py, but I don't recommend trying to
> use the same directory you keep your existing pywikipedia files in).
>
> The bots themselves can be found in the pywikibot/scripts subdirectory under
> the directory to which you checked out the framework.  However, if you add
> this directory to your PYTHONPATH, you should be able to run the scripts
> from any directory.
>
> For those who aren't aware, the rewrite branch is a new pywikipedia
> framework that is designed to be (mostly) backwards-compatible with existing
> scripts, but which uses the MediaWiki API (instead of screen-scraping) for
> all access to wiki contents and metadata.  The idea is to obsolete the
> existing framework and replace it with this branch as soon as testing is
> complete and all major bots have been ported.
>
> Oh, and by the way, patches and other contributions besides bug reports are
> also welcome!
>
> Russ
>
>
> _______________________________________________
> Pywikipedia-l mailing list
> Pywikipedia-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>



-- 
Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ]



More information about the Pywikipedia-l mailing list