Make MarkingsMixin private

Partially so it doesn't clog up the markings API documentation.
stix2.1
Chris Lenk 2017-10-05 20:50:54 -04:00
parent 8b702c6985
commit 9ea4344ca7
4 changed files with 13 additions and 13 deletions

View File

@ -3,7 +3,7 @@
from collections import OrderedDict from collections import OrderedDict
from .base import _STIXBase from .base import _STIXBase
from .markings import MarkingsMixin from .markings import _MarkingsMixin
from .properties import (HashesProperty, IDProperty, ListProperty, Property, from .properties import (HashesProperty, IDProperty, ListProperty, Property,
ReferenceProperty, SelectorProperty, StringProperty, ReferenceProperty, SelectorProperty, StringProperty,
TimestampProperty, TypeProperty) TimestampProperty, TypeProperty)
@ -77,7 +77,7 @@ class MarkingProperty(Property):
raise ValueError("must be a Statement, TLP Marking or a registered marking.") raise ValueError("must be a Statement, TLP Marking or a registered marking.")
class MarkingDefinition(_STIXBase, MarkingsMixin): class MarkingDefinition(_STIXBase, _MarkingsMixin):
_type = 'marking-definition' _type = 'marking-definition'
_properties = OrderedDict() _properties = OrderedDict()
_properties.update([ _properties.update([

View File

@ -224,14 +224,14 @@ def is_marked(obj, marking=None, selectors=None, inherited=False, descendants=Fa
return result return result
class MarkingsMixin(): class _MarkingsMixin():
pass pass
# Note that all of these methods will return a new object because of immutability # Note that all of these methods will return a new object because of immutability
MarkingsMixin.get_markings = get_markings _MarkingsMixin.get_markings = get_markings
MarkingsMixin.set_markings = set_markings _MarkingsMixin.set_markings = set_markings
MarkingsMixin.remove_markings = remove_markings _MarkingsMixin.remove_markings = remove_markings
MarkingsMixin.add_markings = add_markings _MarkingsMixin.add_markings = add_markings
MarkingsMixin.clear_markings = clear_markings _MarkingsMixin.clear_markings = clear_markings
MarkingsMixin.is_marked = is_marked _MarkingsMixin.is_marked = is_marked

View File

@ -6,7 +6,7 @@ import stix2
from .base import _STIXBase from .base import _STIXBase
from .common import ExternalReference, GranularMarking, KillChainPhase from .common import ExternalReference, GranularMarking, KillChainPhase
from .markings import MarkingsMixin from .markings import _MarkingsMixin
from .observables import ObservableProperty from .observables import ObservableProperty
from .properties import (BooleanProperty, IDProperty, IntegerProperty, from .properties import (BooleanProperty, IDProperty, IntegerProperty,
ListProperty, PatternProperty, ReferenceProperty, ListProperty, PatternProperty, ReferenceProperty,
@ -14,7 +14,7 @@ from .properties import (BooleanProperty, IDProperty, IntegerProperty,
from .utils import NOW from .utils import NOW
class STIXDomainObject(_STIXBase, MarkingsMixin): class STIXDomainObject(_STIXBase, _MarkingsMixin):
pass pass

View File

@ -4,14 +4,14 @@ from collections import OrderedDict
from .base import _STIXBase from .base import _STIXBase
from .common import ExternalReference, GranularMarking from .common import ExternalReference, GranularMarking
from .markings import MarkingsMixin from .markings import _MarkingsMixin
from .properties import (BooleanProperty, IDProperty, IntegerProperty, from .properties import (BooleanProperty, IDProperty, IntegerProperty,
ListProperty, ReferenceProperty, StringProperty, ListProperty, ReferenceProperty, StringProperty,
TimestampProperty, TypeProperty) TimestampProperty, TypeProperty)
from .utils import NOW from .utils import NOW
class STIXRelationshipObject(_STIXBase, MarkingsMixin): class STIXRelationshipObject(_STIXBase, _MarkingsMixin):
pass pass