It's ok, problem solved ... just bad indentation, i'm noob with python :/
... Thanks a lot !
Hello!
2009/6/27 reyman <reyman64@gmail.com>:
> Here my family wikiSimpop_family.py :It looks like your indentation is wrong. Is it only the paste not
>
> # -*- coding: utf-8
> -*-
> import family
>
> class Family(family.Family):
> def __init__(self):
> family.Family.__init__(self)
> self.name = 'wikiSimpop'
>
> self.langs = {
> 'fr':
> 'wikiSimpop',
> }
>
> self.namespaces[4] = {
> '_default': [u'wikiSimpop', self.namespaces[4]['_default']],
> 'fr': u'wikiSimpop',
> }
>
> def scriptpath(self, code):
> return '/wikiSimpop'
keeping correct indentation level? Because indentation _does_ matter
for Python :)
scriptpath( ) should be a class member Family, hence "def scriptpath"
should have the same indentation level as "def __init__", otherwise
Python does not define scriptpath as a Family method, but as a
function, and Family.scriptpath() is not overridden.
As an unrelated note,
you probably don't want to override _default. It's default, leave it as it is :)
> self.namespaces[4] = {
> '_default': [u'wikiSimpop', self.namespaces[4]['_default']],
> 'fr': u'wikiSimpop',
> }
> self.namespaces[4]['fr'] = u'wikiSimpop'
should be good enough :)
Bonne chance, ^^
--
Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ]
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l