[Vobject] difference between handling of 2.1 and 3.0

Jeffrey Harris jeffrey at osafoundation.org
Fri Jan 9 13:31:20 CST 2009


Hi Jonathan,

> def getBehavior(name, id=None):
>     name=name.upper()
>     if name in __behaviorRegistry:
>         if id:
>             for n, behavior in __behaviorRegistry[name]:
>                 if n==id:
>                     return behavior
>         else:
>             return __behaviorRegistry[name][0][1]
>     return None

I think we need to remove the else (and lower the indentation of that
fallback return), so the first behavior for that name is returned if
nothing else is found.  That was my original intention but I guess I
never wrote any tests :)

Sincerely,
Jeffrey


More information about the VObject mailing list