nuxeo-localizer
[Top][All Lists]
Advanced

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

Re: [Nuxeo-localizer] Traceback from LocalPropertyManager.get_default_l


From: Juan David Ibáñez Palomar
Subject: Re: [Nuxeo-localizer] Traceback from LocalPropertyManager.get_default_language()
Date: Thu, 13 Feb 2003 10:24:16 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021204 Debian/1.2.1-1

Greg Ward wrote:

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

Sorry for the delay.

Good question. Well, I have changed it in the branch-1-0,
now it will return None, I think this won't break anything
else, but I would appreciate if you test it.


Thanks,

--
J. David Iba'n~ez, http://www.j-david.net
Software Engineer / Inge'nieur Logiciel / Ingeniero de Software






reply via email to

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