Apply OrderedDict changes to bundle, fix import in sdo.py

stix2.1
Emmanuelle Vargas-Gonzalez 2017-08-15 08:24:43 -04:00
parent cb5c4ad080
commit e3f82effc7
2 changed files with 9 additions and 7 deletions

View File

@ -1,5 +1,6 @@
"""STIX 2.0 Objects that are neither SDOs nor SROs""" """STIX 2.0 Objects that are neither SDOs nor SROs"""
from collections import OrderedDict
from . import exceptions from . import exceptions
from .base import _STIXBase from .base import _STIXBase
@ -31,12 +32,13 @@ class STIXObjectProperty(Property):
class Bundle(_STIXBase): class Bundle(_STIXBase):
_type = 'bundle' _type = 'bundle'
_properties = { _properties = OrderedDict()
'type': TypeProperty(_type), _properties.update([
'id': IDProperty(_type), ('type', TypeProperty(_type)),
'spec_version': Property(fixed="2.0"), ('id', IDProperty(_type)),
'objects': ListProperty(STIXObjectProperty), ('spec_version', Property(fixed="2.0")),
} ('objects', ListProperty(STIXObjectProperty)),
])
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
# Add any positional arguments to the 'objects' kwarg. # Add any positional arguments to the 'objects' kwarg.

View File

@ -3,7 +3,7 @@
from collections import OrderedDict from collections import OrderedDict
from .base import _STIXBase from .base import _STIXBase
from .other import ExternalReference, GranularMarking from .common import ExternalReference, GranularMarking
from .properties import (BooleanProperty, IDProperty, IntegerProperty, ListProperty, from .properties import (BooleanProperty, IDProperty, IntegerProperty, ListProperty,
ReferenceProperty, StringProperty, TimestampProperty, ReferenceProperty, StringProperty, TimestampProperty,
TypeProperty) TypeProperty)