You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/usr/lib/python2.7/site-packages/cybox-2.0.1.2-py2.7.egg/cybox/bindings/cybox_core.py", line 912, in exportChildren
self.Observable_Package_Source.export(outfile, level, "cybox:", name_='Observable_Package_Source', pretty_print=pretty_print)
AttributeError: 'MeasureSource' object has no attribute 'export'
Am I adding the Observable_Package_Source incorrectly?
...
The text was updated successfully, but these errors were encountered:
Hey, @kkuehl, sorry for the (woefully) late response.
It looks like you might be mixing "bindings" objects and "API" objects. Most bindings objects have class names ending in Type, and you manipulate them by calling get_X or set_X. API classes do not end in Type, and you manipulate them by directly getting or setting attributes. It looks like "observables" is a binding object (cybox.bindings.cybox_core.ObservablesType), while source is an API object cybox.common.MeasureSource.
but you might be better off using the API version: cybox.core.Observables. API objects were designed to be easier to use than the bindings objects, which are defined in auto-generated code. to_obj converts an API object to a binding object, and you can do the reverse with Observables.from_obj(<binding_obj>)
I am attempting to add Observable_Package_Source.
File "/usr/lib/python2.7/site-packages/cybox-2.0.1.2-py2.7.egg/cybox/bindings/cybox_core.py", line 912, in exportChildren
self.Observable_Package_Source.export(outfile, level, "cybox:", name_='Observable_Package_Source', pretty_print=pretty_print)
AttributeError: 'MeasureSource' object has no attribute 'export'
Am I adding the Observable_Package_Source incorrectly?
...
The text was updated successfully, but these errors were encountered: