imported>Mathieu |
imported>Mathieu |
Line 1: |
Line 1: |
− | A bot may be a useful tool to help a wiki maintenance.
| + | <noinclude> |
| + | ==Usage== |
| + | Template use to typeset the end of a component. |
| + | ==Example== |
| | | |
− | I tried to use the python framework provided by http://pywikipediabot.sourceforge.net/. Hereafter are some guidelines to make it work on this wiki.
| + | {{l_machine|AntiCollide}} |
| + | {{l_refines|Safety}} |
| + | {{l_sees|Network|CDV|Acyclic}} |
| + | {{l_Variables|v1|v2|v3}} |
| | | |
− | == Requirements ==
| + | {{l_end}} |
− | * Python >2.5
| |
| | | |
− | == Getting pywikipedia framewok ==
| + | [[Category:Listing templates]] |
− | Get the source code from subversion:
| + | ==Template== |
− | <pre><nowiki>
| + | </noinclude><!-- |
− | (prompt) svn co http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia pywikipedia
| + | --><p class="typeset-l_end" style="font-family:monospace;color:black;font-weight:bold;">END</p> |
− | </nowiki></pre>
| + | </div> |
− | == Configuring the framework for this wiki == | |
− | Add the following <tt>families/eventb_family.py</tt> file (be careful with the indentation):
| |
− | <pre><nowiki>
| |
− | # -*- coding: utf-8 -*-
| |
− | | |
− | import family
| |
− | # The event-b family
| |
− | # user-config.py: usernames['event-b']['event-b'] = 'User name'
| |
− | class Family(family.Family): | |
− | def __init__(self):
| |
− | family.Family.__init__(self)
| |
− | self.name = 'eventb'
| |
− | self.langs = {
| |
− | 'eventb': 'wiki.event-b.org',
| |
− | }
| |
− | | |
− | self.namespaces[4] = {
| |
− | '_default': [u'Event-B', self.namespaces[4]['_default']],
| |
− | }
| |
− | | |
− | self.namespaces[5] = {
| |
− | '_default': [u'Event-B talk', self.namespaces[5]['_default']],
| |
− | }
| |
− | | |
− | def version(self, code):
| |
− | return '1.11'
| |
− | | |
− | def path(self, code):
| |
− | return '/index.php' #The path of index.php, look at your wiki address.
| |
− | | |
− | def scriptpath(self,code):
| |
− | return ''
| |
− |
| |
− | # def shared_image_repository(self, code):
| |
− | # return ('commons', 'commons')
| |
− | '_default': [u'Event-B talk', self.namespaces[5]['_default']],
| |
− | </nowiki></pre>
| |
− | | |
− | Then add the following <tt>user-config.py</tt> file:
| |
− | <pre><nowiki>
| |
− | family='eventb'
| |
− | mylang='eventb'
| |
− | usernames['eventb']['eventb'] = 'your_bot_user_name'
| |
− | </nowiki></pre>
| |
− | | |
− | == Usage ==
| |
− | === Login ===
| |
− | First you should log in:
| |
− | <pre><nowiki>
| |
− | (prompt) python login.py
| |
− | </nowiki></pre>
| |
− | === Upload Images ===
| |
− | <pre><nowiki>
| |
− | (prompt) python upload.py -noverify -keep file.png "Image description"
| |
− | </nowiki></pre>
| |
− | | |
− | For uploading several images from a directory, I use the following ''sh'' command:
| |
− | <pre><nowiki>
| |
− | for i in /tmp/imagedir/* ; do (yes | python upload.py -v -noverify -keep $i "Import of image $i"); done
| |
− | </nowiki></pre>
| |