diff --git a/ChangeLog b/ChangeLog index f2b20813..45fc86c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-02-04 Ozan Çağlayan + * pisi/pxml/autoxml.py (format): Some optional elements may be None + during formatting, handle those situations. We still have a formatting + issue caused by the automagical output representation of autoxml. + 2010-02-02 Ozan Çağlayan * pisi/component.py(Maintainer): Add Maintainer tag to components.xml. diff --git a/pisi/pxml/autoxml.py b/pisi/pxml/autoxml.py index f381047c..615d6665 100644 --- a/pisi/pxml/autoxml.py +++ b/pisi/pxml/autoxml.py @@ -727,11 +727,16 @@ class autoxml(oo.autosuper, oo.autoprop): return obj.errors(where) def format(obj, f, errs): - try: - obj.format(f, errs) - except Error: + if obj: + try: + obj.format(f, errs) + except Error: + if req == mandatory: + errs.append(_('Object cannot be formatted')) + else: if req == mandatory: errs.append(_('Mandatory argument not available')) + return (init, decode, encode, errors, format) def gen_list_tag(cls, tag, spec): @@ -841,9 +846,13 @@ class autoxml(oo.autosuper, oo.autoprop): return obj.errors(where) def format(obj, f, errs): - try: - obj.format(f, errs) - except Error: + if obj: + try: + obj.format(f, errs) + except Error: + if req == mandatory: + errs.append(_('Object cannot be formatted')) + else: if req == mandatory: errs.append(_('Mandatory argument not available'))