[Pywikipedia-l] Running the rewrite branch as developer/power-user

Merlijn van Deen valhallasw at arctus.nl
Sun Jan 16 12:31:34 UTC 2011


Hello all,

As several people have mentioned they had trouble starting with the rewrite
branch, I decided to do a step-by-step log of installing the rewrite in a
way that is good for developing -- this means you are able to edit the
framework files, while not inflicting any changes on other users (or other
bots you run!) of the system. By using setup.py develop, edits you make to
the framework will immediately be used (no need to setup.py install them),
but only *within the virtualenv*.

As a prerequisite, install virtualenv. All other dependencies should be
installed automatically. The following is a log of what I did - and what you
could/should do ;-) The output is monospaced, the things I entered are *bold
*.

------------------------------------------------
valhallasw at dorthonion:~/src$ *virtualenv pwb*
New python executable in pwb/bin/python
Installing setuptools............done.
valhallasw at dorthonion:~/src$ *cd pwb*
valhallasw at dorthonion:~/src/pwb$ *source bin/activate # activate virtualenv*
(*pwb*)valhallasw at dorthonion:~/src/pwb$ *mkdir src*
(*pwb*)valhallasw at dorthonion:~/src/pwb$ *cd src*
(*pwb*)valhallasw at dorthonion:~/src/pwb/src$ *svn co svn+ssh://
svn.wikimedia.org/svnroot/pywikipedia/branches/rewrite/ .  # note trailing
dot*
A    generate_user_files.py
A    pywikibot
(...snip...)
Checked out revision 8837.
(*pwb*)valhallasw at dorthonion:~/src/pwb/src$ *python setup.py develop*
Downloading
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
(...snip...)
Finished processing dependencies for Pywikipediabot==2.0alpha

Your default user directory is "/home/valhallasw/.pywikibot"
How to proceed? ([K]eep [c]hange) *c*
New user directory? */home/valhallasw/src/pwb/conf*
OK: Created new directory.
WARNING: Your user files will be created in the directory
'/home/valhallasw/src/pwb/conf' you have chosen. To access these files, you
will either have to use the argument "-dir:/home/valhallasw/src/pwb/conf"
every time you run the bot, or set the environment variable "PYWIKIBOT2_DIR"
equal to this directory name in your operating system. See your operating
system documentation for how to set environment variables.
Is this OK? ([yes], [N]o) *y*
Do you want to copy user files from an existing pywikipedia installation? *y
*
Path to existing wikipedia.py? */home/valhallasw/src/pywikipedia/trunk*
NOTE: user-config.py already exists in the directory
Create user-fixes.py file? ([y]es, [N]o) *n*
(*pwb*)valhallasw at dorthonion:~/src/pwb/src$ *echo "export
PYWIKIBOT2_DIR=/home/valh allasw/src/pwb/conf" >> ../bin/activate*
(*pwb*)valhallasw at dorthonion:~/src/pwb/src$ *source ../bin/activate*
(*pwb*)valhallasw at dorthonion:~/src/pwb/src$ *cd scripts/*
(*pwb*)valhallasw at dorthonion:~/src/pwb/src/scripts$ *python touch.py
Gebruiker:Valhallasw*
Password for user valhallasw on wikipedia:nl:
Logging in to wikipedia:nl as valhallasw
Retrieving 1 pages from wikipedia:nl.
Page [[Gebruiker:Valhallasw]] saved
-----------------------------------------------------------------------------------

Now, the next time you want to run the bot, you have to do the following:
-----------------------------------------------------------------------------------
valhallasw at dorthonion:~$ *cd ~/src/pwb/src/scripts/*
valhallasw at dorthonion:~/src/pwb/src/scripts$ *source ../../bin/activate*
(*pwb*)valhallasw at dorthonion:~/src/pwb/src/scripts$ *python touch.py
Gebruiker:Valhallasw*
Password for user valhallasw on wikipedia:nl:
Logging in to wikipedia:nl as valhallasw
Retrieving 1 pages from wikipedia:nl.
Page [[Gebruiker:Valhallasw]] saved
-----------------------------------------------------------------------------------

Best regards,
Merlijn van Deen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wikimedia.org/pipermail/pywikipedia-l/attachments/20110116/2a1375ac/attachment-0001.htm 


More information about the Pywikipedia-l mailing list