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"""
from collections import OrderedDict
from . import exceptions
from .base import _STIXBase
@ -31,12 +32,13 @@ class STIXObjectProperty(Property):
class Bundle(_STIXBase):
_type = 'bundle'
_properties = {
'type': TypeProperty(_type),
'id': IDProperty(_type),
'spec_version': Property(fixed="2.0"),
'objects': ListProperty(STIXObjectProperty),
}
_properties = OrderedDict()
_properties.update([
('type', TypeProperty(_type)),
('id', IDProperty(_type)),
('spec_version', Property(fixed="2.0")),
('objects', ListProperty(STIXObjectProperty)),
])
def __init__(self, *args, **kwargs):
# Add any positional arguments to the 'objects' kwarg.

View File

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