Fix imports, sort requirements.
parent
4ffc8edeeb
commit
15b5e107d5
6
setup.py
6
setup.py
|
@ -47,10 +47,10 @@ setup(
|
||||||
keywords="stix stix2 json cti cyber threat intelligence",
|
keywords="stix stix2 json cti cyber threat intelligence",
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'pytz',
|
|
||||||
'six',
|
|
||||||
'python-dateutil',
|
'python-dateutil',
|
||||||
|
'pytz',
|
||||||
'requests',
|
'requests',
|
||||||
'simplejson'
|
'simplejson',
|
||||||
|
'six'
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -529,7 +529,6 @@ class CompositeDataSource(object):
|
||||||
"""
|
"""
|
||||||
return copy.deepcopy(self.data_sources.values())
|
return copy.deepcopy(self.data_sources.values())
|
||||||
|
|
||||||
|
|
||||||
def deduplicate(self, stix_obj_list):
|
def deduplicate(self, stix_obj_list):
|
||||||
"""Deduplicate a list of STIX objects to a unique set
|
"""Deduplicate a list of STIX objects to a unique set
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ from collections import OrderedDict
|
||||||
|
|
||||||
from .base import _STIXBase
|
from .base import _STIXBase
|
||||||
from .common import ExternalReference, GranularMarking
|
from .common import ExternalReference, GranularMarking
|
||||||
from .properties import (BooleanProperty, IDProperty, IntegerProperty, ListProperty,
|
from .properties import (BooleanProperty, IDProperty, IntegerProperty,
|
||||||
ReferenceProperty, StringProperty, TimestampProperty,
|
ListProperty, ReferenceProperty, StringProperty,
|
||||||
TypeProperty)
|
TimestampProperty, TypeProperty)
|
||||||
from .utils import NOW
|
from .utils import NOW
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
"""Utility functions and classes for the stix2 library."""
|
"""Utility functions and classes for the stix2 library."""
|
||||||
|
|
||||||
from stix2 import base
|
|
||||||
|
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
import pytz
|
import pytz
|
||||||
|
|
||||||
|
from .base import _STIXBase
|
||||||
|
|
||||||
# Sentinel value for properties that should be set to the current time.
|
# Sentinel value for properties that should be set to the current time.
|
||||||
# We can't use the standard 'default' approach, since if there are multiple
|
# We can't use the standard 'default' approach, since if there are multiple
|
||||||
# timestamps in a single object, the timestamps will vary by a few microseconds.
|
# timestamps in a single object, the timestamps will vary by a few microseconds.
|
||||||
|
@ -132,7 +132,7 @@ def find_property_index(obj, properties, tuple_to_find):
|
||||||
for pv in obj._inner.values():
|
for pv in obj._inner.values():
|
||||||
if isinstance(pv, list):
|
if isinstance(pv, list):
|
||||||
for item in pv:
|
for item in pv:
|
||||||
if isinstance(item, base._STIXBase):
|
if isinstance(item, _STIXBase):
|
||||||
val = find_property_index(item,
|
val = find_property_index(item,
|
||||||
item._object_properties(),
|
item._object_properties(),
|
||||||
tuple_to_find)
|
tuple_to_find)
|
||||||
|
@ -145,7 +145,7 @@ def find_property_index(obj, properties, tuple_to_find):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return len(tuple_to_find[0])
|
return len(tuple_to_find[0])
|
||||||
for item in pv.values():
|
for item in pv.values():
|
||||||
if isinstance(item, base._STIXBase):
|
if isinstance(item, _STIXBase):
|
||||||
val = find_property_index(item,
|
val = find_property_index(item,
|
||||||
item._object_properties(),
|
item._object_properties(),
|
||||||
tuple_to_find)
|
tuple_to_find)
|
||||||
|
|
Loading…
Reference in New Issue