magic value enumerations

pull/26/head
Jurriaan Bremer 2016-08-16 16:51:35 +02:00
parent f23a7c3357
commit 353d04eab3
1 changed files with 28 additions and 0 deletions

View File

@ -33,6 +33,29 @@ except NameError:
basestring = str basestring = str
class distributions(object):
"""Enumeration of the available distributions."""
your_organization = 0
this_community = 1
connected_communities = 2
all_communities = 3
class threat_level(object):
"""Enumeration of the available threat levels."""
high = 1
medium = 2
low = 3
undefined = 4
class analysis(object):
"""Enumeration of the available analysis statuses."""
initial = 0
ongoing = 1
completed = 2
class PyMISPError(Exception): class PyMISPError(Exception):
def __init__(self, message): def __init__(self, message):
super(PyMISPError, self).__init__(message) super(PyMISPError, self).__init__(message)
@ -95,6 +118,11 @@ class PyMISP(object):
:param proxies: Proxy dict as describes here: http://docs.python-requests.org/en/master/user/advanced/#proxies :param proxies: Proxy dict as describes here: http://docs.python-requests.org/en/master/user/advanced/#proxies
""" """
# So it can may be accessed from the misp object.
distributions = distributions
threat_level = threat_level
analysis = analysis
def __init__(self, url, key, ssl=True, out_type='json', debug=False, proxies=None): def __init__(self, url, key, ssl=True, out_type='json', debug=False, proxies=None):
if not url: if not url:
raise NoURL('Please provide the URL of your MISP instance.') raise NoURL('Please provide the URL of your MISP instance.')