* automxl:
- fix: equal must handle comparison with None - a small cleanup (more fixes to come)
This commit is contained in:
@@ -273,8 +273,6 @@ class autoxml(oo.autosuper, oo.autoprop):
|
|||||||
encoders = []
|
encoders = []
|
||||||
errorss = []
|
errorss = []
|
||||||
formatters = []
|
formatters = []
|
||||||
#order = dict.keys()
|
|
||||||
#order.sort()
|
|
||||||
|
|
||||||
# read declaration order from source
|
# read declaration order from source
|
||||||
# code contributed by bahadir kandemir
|
# code contributed by bahadir kandemir
|
||||||
@@ -321,13 +319,9 @@ class autoxml(oo.autosuper, oo.autoprop):
|
|||||||
def initialize(self, uri = None, keepDoc = False, tmpDir = '/tmp',
|
def initialize(self, uri = None, keepDoc = False, tmpDir = '/tmp',
|
||||||
**args):
|
**args):
|
||||||
if xmlfile_support:
|
if xmlfile_support:
|
||||||
# totally dailywtf
|
if args.has_key('tag'):
|
||||||
#if args.has_key('tag'):
|
XmlFile.__init__(self, tag = args['tag'])
|
||||||
# tag = args['tag']
|
else:
|
||||||
#else:
|
|
||||||
# tag = self.__class__.tag # ought to be autoxml
|
|
||||||
#XmlFile.__init__(self, tag = tag)
|
|
||||||
if not args.has_key('tag'):
|
|
||||||
XmlFile.__init__(self, tag = cls.tag)
|
XmlFile.__init__(self, tag = cls.tag)
|
||||||
for base in cls.autoxml_bases:
|
for base in cls.autoxml_bases:
|
||||||
base.__init__(self)
|
base.__init__(self)
|
||||||
@@ -409,6 +403,9 @@ class autoxml(oo.autosuper, oo.autoprop):
|
|||||||
|
|
||||||
if not dict.has_key('__eq__'):
|
if not dict.has_key('__eq__'):
|
||||||
def equal(self, other):
|
def equal(self, other):
|
||||||
|
# handle None
|
||||||
|
if other ==None:
|
||||||
|
return False # well, must be False at this point :)
|
||||||
for name in names:
|
for name in names:
|
||||||
try:
|
try:
|
||||||
if getattr(self, name) != getattr(other, name):
|
if getattr(self, name) != getattr(other, name):
|
||||||
|
|||||||
Reference in New Issue
Block a user