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 20:50:52 +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:

[me, trying to figure out what's causing a traceback in Localizer]
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?


[Juan David Ibáñez Palomar replies]
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.

Unfortunately, my priority right now is to Get Things Working, elegance
be damned.  If I get a few minutes, I'll try to checkout the Localizer
code from CVS (that's what you're asking, right?) and give it a try, but
no promises.


right, from the branch labeled "branch-1-0"


Anyways, I kludged around the problem in the class that's closest to
Localizer but still under my control:

 class LocDublinCoreImpl(LocalPropertyManager, DefaultDublinCoreImpl):
     [...]
     def __init__(self, ...):
         [...]
         self._languages = ("en", "fr",) # XXX should come from Localizer
         self._default_language = "fr"   # XXX this too

Needless to say: blecchhh!  Presumably these values should come from the
Localizer instance in my Zope tree -- but they don't.  Is there
something I have to do to ensure my LocalPropertyManager subclass gets
those values from the Localizer instance?


When you add a new LocalContent object the languages input
box of the add form includes the languages from the Localizer
object, if it exists.

Just get the Localizer instance through acquisition and ask
it for the languages it has.

The problem is that within the "__init__" method "self" is
not an acquisition wrapper so you can't get the Localizer
object from it. I think you should pass the languages as a
parameter.

Is this what you asked for?

Thanks --

       Greg


--
J. David Ibáñez, http://www.j-david.net
Software Engineer / Ingénieur Logiciel / Ingeniero de Software






reply via email to

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