Interesting new error
 
D:\Development\python>python login.py
Traceback (most recent call last):
  File "login.py", line 58, in <module>
    import re, os, query
  File "d:\development\pymw\query.py", line 28, in <module>
    import wikipedia, time
  File "D:\development\pymw\wikipedia.py", line 143, in <module>
    from pywikibot import *
  File "d:\development\pymw\pywikibot\__init__.py", line 15, in <module>
    from exceptions import *
  File "d:\development\pymw\pywikibot\exceptions.py", line 13, in <module>
    import config
  File "D:\development\pymw\config.py", line 513, in <module>
    execfile(_filename)
  File "D:\Development\python\user-config.py", line 4, in <module>
    usernames['ncdb']['en'] = u'root'
KeyError: 'ncdb'
 
From: Bináris
Sent: Thursday, December 23, 2010 2:35 PM
Subject: Re: [Pywikipedia-l] setting my custom bot for my ncdb wiki
 
File "D:\development\pymw\families\ncdb_family.py", line 152
   def version(self, code):
     ^
IndentationError: expected an indented block


Look, I found the error for you in the pastebin.

  1.     def apipath(self, code):
  2.         # raise NotImplementedError, "%s wiki family does not support api.php" % self.name
  3.         # return '%s/api.php' % self.scriptpath(code)
  4.  
  5.     # Which version of MediaWiki is used? REQUIRED
  6.     def version(self, code):
  7.         # Replace with the actual version being run on your wiki
  8.         return '1.16.0'
For some reasons, the numbering begins from 1 after copying, but it is at the given place. The previous function contains ONLY comments, therefore it is not accepted and you get an indentation error. But the real error is not in line 152, it is in function apipath, which should contain at least one not-commented line. If you are sure that all this must be commented, then put a "pass" (empty instruction) in the apipath function, but I think that a function should return some value under any circumstances, that's why it is a function.


--
Bináris


_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l