Make pep8 happy

pull/21/head
Raphaël Vinot 2016-06-15 11:44:08 +09:00
parent 469a97972f
commit a42be22f78
1 changed files with 4 additions and 7 deletions

View File

@ -995,7 +995,7 @@ class PyMISP(object):
session = self.__prepare_session(force_out) session = self.__prepare_session(force_out)
if (context != 'category'): if (context != 'category'):
context = 'type' context = 'type'
if(percentage!=None): if percentage is not None:
url = urljoin(self.root_url, 'attributes/attributeStatistics/{}/{}'.format(context, percentage)) url = urljoin(self.root_url, 'attributes/attributeStatistics/{}/{}'.format(context, percentage))
else: else:
url = urljoin(self.root_url, 'attributes/attributeStatistics/{}'.format(context)) url = urljoin(self.root_url, 'attributes/attributeStatistics/{}'.format(context))
@ -1006,11 +1006,11 @@ class PyMISP(object):
Get tags statistics from the MISP instance Get tags statistics from the MISP instance
""" """
session = self.__prepare_session(force_out) session = self.__prepare_session(force_out)
if (percentage != None): if percentage is not None:
percentage = 'true' percentage = 'true'
else: else:
percentage = 'false' percentage = 'false'
if (name_sort != None): if name_sort is not None:
name_sort = 'true' name_sort = 'true'
else: else:
name_sort = 'false' name_sort = 'false'
@ -1040,10 +1040,9 @@ class PyMISP(object):
def get_sharing_groups(self): def get_sharing_groups(self):
session = self.__prepare_session(force_out=None) session = self.__prepare_session(force_out=None)
url = urljoin(self.root_url, 'sharing_groups/index.json') url = urljoin(self.root_url, 'sharing_groups/index.json')
response = session.get(url) response = session.get(url)
return self._check_response(response)['response'][0] return self._check_response(response)['response'][0]
# ############## Deprecated (Pure XML API should not be used) ################## # ############## Deprecated (Pure XML API should not be used) ##################
@deprecated @deprecated
def download_all(self): def download_all(self):
@ -1068,5 +1067,3 @@ class PyMISP(object):
template = urljoin(self.root_url, 'events/xml/download/{}/{}'.format(event_id, attach)) template = urljoin(self.root_url, 'events/xml/download/{}/{}'.format(event_id, attach))
session = self.__prepare_session('xml') session = self.__prepare_session('xml')
return session.get(template) return session.get(template)