added TimestampConstant

stix2.1
Richard Piazza 2017-08-17 14:50:42 -04:00
parent 513b172a5c
commit fb75de47c5
2 changed files with 11 additions and 1 deletions

View File

@ -37,7 +37,7 @@ from .patterns import (AndBooleanExpression, AndObservationExpression,
OrObservationExpression, ParentheticalExpression,
QualifiedObservationExpression,
ReferenceObjectPathComponent, RepeatQualifier,
StartStopQualifier, StringConstant, WithinQualifier)
StartStopQualifier, StringConstant, TimestampConstant, WithinQualifier)
from .sdo import (AttackPattern, Campaign, CourseOfAction, CustomObject,
Identity, Indicator, IntrusionSet, Malware, ObservedData,
Report, ThreatActor, Tool, Vulnerability)
@ -47,6 +47,7 @@ from .version import __version__
OBJ_MAP = {
'attack-pattern': AttackPattern,
'bundle': Bundle,
'campaign': Campaign,
'course-of-action': CourseOfAction,
'identity': Identity,

View File

@ -19,6 +19,15 @@ class StringConstant(_Constant):
return "'%s'" % escape_quotes_and_backslashes(self.value)
class TimestampConstant(_Constant):
def __init__(self, value):
self.value = value
def __str__(self):
return "'%s'" % escape_quotes_and_backslashes(self.value)
class IntegerConstant(_Constant):
def __init__(self, value):
try: