ntt / eveapi

Python library for accessing the EVE Online API
Other
148 stars 57 forks source link

eveapi starbase detail not pulling correctly. part 2 #10

Closed ajurna closed 12 years ago

ajurna commented 12 years ago

from version 1.2.3

cs.onStatusDrop.standing Traceback (most recent call last): File "", line 1, in AttributeError: 'Element' object has no attribute 'standing' from version 1.1.9 cs.onStatusDrop.standing 0

this follows on from the previous issue. is it possible that if it gets an api response with 0 as the result it takes it a null value and doesn't write the string?

tash commented 12 years ago

in tag_end: if (not self.has_cdata) and self._last is this and name != 'rowset': if attributes:

tag of the form <tag attribute=bla ... />

                    e = Element()
                    setattr(self.container, this._name, e)
                    for i in xrange(0, len(attributes), 2):
                        setattr(e, attributes[i], attributes[i+1])
                else:
                    # tag of the form: <tag />, treat as empty string.
                    setattr(self.container, this._name, "")
            else:
                self.container._attributes2.append(this._name)
                setattr(self.container, this._name, this)
ntt commented 12 years ago

hurrr derp. I must have been sleeping, I could have sworn I put i / i+1 when I wrote that :P Thanks again. Had to fix another little thing anyway, too. Fix pushed. Keeping version at 1.2.3 for no real reason, too! :P

tash commented 12 years ago

you should check the name for 'rowset' too (2nd line previous post... otherwise if it has no cdata like "<rowset/>", the element won't be de-serialized as dict, but as an empty string, which is annoying ;)

ntt commented 12 years ago

It actually presents empty rowsets that way? Strange, I thought they were matched pairs of tags before.

Pushed. Anything else? :)

tash commented 12 years ago

empty starbase lists are returned that way. looking good, tyvm :)