From f4335f43ad280903afa392c880098206d71fdd35 Mon Sep 17 00:00:00 2001 From: Greg Back Date: Wed, 19 Jul 2017 21:12:56 +0000 Subject: [PATCH] Clean up redundant code. --- stix2/sources/__init__.py | 12 ++---------- stix2/sources/filesystem.py | 8 -------- stix2/sources/memory.py | 8 -------- stix2/sources/taxii.py | 10 +--------- 4 files changed, 3 insertions(+), 35 deletions(-) diff --git a/stix2/sources/__init__.py b/stix2/sources/__init__.py index e25aeb0..38c8e41 100644 --- a/stix2/sources/__init__.py +++ b/stix2/sources/__init__.py @@ -67,16 +67,8 @@ class DataStore(object): def __init__(self, name="DataStore"): self.name = name self.id = make_id() - self.source = DataSource() - self.sink = DataSink() - - @property - def source(self): - return self.source - - @property - def sink(self): - return self.sink + self.source = None + self.sink = None def get(self, stix_id): """ diff --git a/stix2/sources/filesystem.py b/stix2/sources/filesystem.py index a8b6de0..374bdde 100644 --- a/stix2/sources/filesystem.py +++ b/stix2/sources/filesystem.py @@ -26,14 +26,6 @@ class FileSystemStore(DataStore): self.source = FileSystemSource(stix_dir=stix_dir) self.sink = FileSystemSink(stix_dir=stix_dir) - @property - def source(self): - return self.source - - @property - def sink(self): - return self.sink - # file system sink API calls def add(self, stix_objs): diff --git a/stix2/sources/memory.py b/stix2/sources/memory.py index b14e683..ecfc790 100644 --- a/stix2/sources/memory.py +++ b/stix2/sources/memory.py @@ -64,14 +64,6 @@ class MemoryStore(DataStore): self.source = MemorySource(stix_data=self.data, _store=True) self.sink = MemorySink(stix_data=self.data, _store=True) - @property - def source(self): - return self.source - - @property - def sink(self): - return self.sink - # memory sink API calls def add(self, stix_data): diff --git a/stix2/sources/taxii.py b/stix2/sources/taxii.py index b6aea31..e892fcc 100644 --- a/stix2/sources/taxii.py +++ b/stix2/sources/taxii.py @@ -32,15 +32,7 @@ class TAXIICollectionStore(DataStore): self.name = name self.id = make_id() self.source = TAXIICollectionSource(taxii_client, api_root_name, collection_id, user, password) - self.sink = self.TAXIICollectionSink(taxii_client, api_root_name, collection_id, user, password) - - @property - def source(self): - return self.source - - @property - def sink(self): - return self.sink + self.sink = TAXIICollectionSink(taxii_client, api_root_name, collection_id, user, password) # file system sink API calls