robert rottermann wrote at 2005-6-23 09:16 +0200:
> ...
>Calling the method in a test case I allways get None.
> ...
>   security.declareProtected('Access contents information', 'getValueFor')
>   def getValueFor(self, key):
>       # Returns value for property;
>       # if available, a dynamic getter will be used
>
>       # we can not use MailBoxers getValueFor since
>       # it does not work with  skin elements on the FS
>             getter = self.getProperty('getter')

I expect that your mail composer distorted indentation
in the line above.

As it stands here, it is a SyntaxError.

>       if getter:
>           getterHandler = self.unrestrictedTraverse(getter, default=None)
>           if getterHandler is not None:
>               try:
>                   result = getterHandler(key)
>                   if result is not None:
>                       return result
>               except:
>                       pass
>
>       # Our stored properties are the default
>       return self.getProperty(key)

It this function returns "None", then "self.getProperty(key)"
(among others) must return "None".

If "unrestrictedTraverse" returns "None", remove the "default="
argument an look at the resulting exception...

-- 
Dieter
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to