nuxeo-localizer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nuxeo-localizer] Traceback from LocalPropertyManager.get_default_langu


From: Greg Ward
Subject: [Nuxeo-localizer] Traceback from LocalPropertyManager.get_default_language()
Date: Tue, 11 Feb 2003 11:45:02 -0500
User-agent: Mutt/1.5.3i

I'm trying to create a multilingual content type for CMF using
Localizer.  I'm following Rainer Thaden's LocCMFProduct as an example,
and using some of his code (the LocDefaultDublinCoreImpl class, in case
anyone's familiar with it).  (Rainer's work is available at
http://cmf.zope.org/Members/rthaden/LocCMFProduct/LocCMFProductHowTo/view .)

I'm having a problem that might be a shallow little bug in Localizer,
but is (I suspect) more likely my fault.  In particular, I keep getting
"tuple index out of range" errors from
LocalPropertyManager.get_default_language(); looking at the code the
problem is fairly obvious:

    def get_default_language(self):
        """ """
        return self._default_language or self.get_languages()[0]

LanguageManager dictates that self._default_language is None in a
brand-new LocalPropertyManager object, so we fall through to the
self.get_languages() call; again LanguageManager dictates that this will
return an empty tuple in a new LocalPropertyManager object.  Hence the
tuple index error.

So who's at fault here?  Have I failed to initialize things properly,
ie. should LocDefaultDublinCoreImpl (which is the object at fault here,
I think) be doing something to ensure that either or both of
_default_language or _languages is set?  Or is LocalPropertyManager
failing to account for the "brand-new object" case?

        Greg
-- 
Greg Ward <address@hidden>                         http://www.gerg.ca/
Condense soup, not books!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]