Improvements on Element value parser and display
Implements multiple suggestions from @lpenasa to improve PTR Element
value parser and display:
-
Raise an AttributeError
onElementWindow
attribute edits:
>>> obs = ObsBlock('2032-01-01T10', '2032-01-01T12')
>>> obs.start = 'foo'
AttributeError: can't set attribute 'start'
-
Add xml representation of iterable in Element
(separated with double spaces):
>>> Element('foo', [1, 2, 3])
<foo> 1 2 3 </foo>
-
Add Element.value
type parsing:
>>> Element('foo', [1, 2, 3]).value
[1, 2, 3]
>>> Element('foo', '2032-01-01').value
datetime.datetime(2032, 1, 1, 0, 0)
-
Return self
onElement.set_value()
method:
>>> el = Element('foo', 'bar')
>>> el.set_value('baz')
<foo> baz </foo>
-
Fix PTX parser and AGM simulator on non-stripped PTR content:
>>> read_ptr('''
<startTime> 2034-03-20T15:22:25 </startTime>
''')
<startTime> 2034-03-20T15:22:25 </startTime>
Minor changes:
-
Customize Element indentation value:
>>> Element.INDENT
' '
-
Update B. Seignovert affiliation.
Closes #2 (closed)