-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9996179
commit 0f94839
Showing
4 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
A class to represent Threat Events | ||
""" | ||
from collections import UserDict | ||
|
||
from .threat_source import ThreatSource | ||
|
||
class ThreatEvent(UserDict): # pylint: disable=too-many-ancestors | ||
""" | ||
A class to represent Threat Events | ||
""" | ||
def __init__(self, name: str, threat_source: ThreatSource) -> None: | ||
UserDict.__init__(self) | ||
self.data = {} | ||
self.data['name'] = name | ||
self.data['threat_source'] = threat_source | ||
|
||
|
||
class ThreatEvents(UserDict): # pylint: disable=too-many-ancestors | ||
""" | ||
A class to hold multiple Threat Events | ||
""" | ||
def new(self, name: str, threat_source: ThreatSource) -> ThreatEvent: | ||
""" | ||
A method to add a new threat event to the Threat Events class | ||
""" | ||
self.data[name] = ThreatEvent(name, threat_source) | ||
return self.data[name] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters