mirror of https://github.com/MISP/PyMISP
chg: [dev] change type() == list
parent
0eb209c7df
commit
de994fd944
|
@ -34,7 +34,7 @@ class MicroblogObject(AbstractMISPObjectGenerator):
|
|||
|
||||
# Archive of the original document (Internet Archive, Archive.is, etc).
|
||||
if self._parameters.get('archive'):
|
||||
if type(self._parameters.get('archive')) is list:
|
||||
if type(self._parameters.get('archive')) == list:
|
||||
for i in self._parameters.get('archive'):
|
||||
self.add_attribute('archive', value=i)
|
||||
else:
|
||||
|
@ -69,7 +69,7 @@ class MicroblogObject(AbstractMISPObjectGenerator):
|
|||
type_allowed_values = ["Twitter", "Facebook", "LinkedIn", "Reddit", "Google+",
|
||||
"Instagram", "Forum", "Other"]
|
||||
if self._parameters.get('type'):
|
||||
if type(self._parameters.get('type')) is list:
|
||||
if type(self._parameters.get('type')) == list:
|
||||
for i in self._parameters.get('type'):
|
||||
if i in type_allowed_values:
|
||||
self.add_attribute('type', value=i)
|
||||
|
@ -80,7 +80,7 @@ class MicroblogObject(AbstractMISPObjectGenerator):
|
|||
# State of the microblog post.
|
||||
type_allowed_values = ["Informative", "Malicious", "Misinformation", "Disinformation", "Unknown"]
|
||||
if self._parameters.get('state'):
|
||||
if type(self._parameters.get('state')) is list:
|
||||
if type(self._parameters.get('state')) == list:
|
||||
for i in self._parameters.get('state'):
|
||||
if i in type_allowed_values:
|
||||
self.add_attribute('state', value=i)
|
||||
|
@ -92,10 +92,10 @@ class MicroblogObject(AbstractMISPObjectGenerator):
|
|||
if self._parameters.get('username'):
|
||||
self.add_attribute('username', value=self._parameters['username'])
|
||||
|
||||
# Is the username account verified by the operator of the microblog platform.
|
||||
# == the username account verified by the operator of the microblog platform.
|
||||
type_allowed_values = ["Verified", "Unverified", "Unknown"]
|
||||
if self._parameters.get('verified-username'):
|
||||
if type(self._parameters.get('verified-username')) is list:
|
||||
if type(self._parameters.get('verified-username')) == list:
|
||||
for i in self._parameters.get('verified-username'):
|
||||
if i in type_allowed_values:
|
||||
self.add_attribute('verified-username', value=i)
|
||||
|
@ -105,7 +105,7 @@ class MicroblogObject(AbstractMISPObjectGenerator):
|
|||
|
||||
# embedded-link.
|
||||
if self._parameters.get('embedded-link'):
|
||||
if type(self._parameters.get('embedded-link')) is list:
|
||||
if type(self._parameters.get('embedded-link')) == list:
|
||||
for i in self._parameters.get('embedded-link'):
|
||||
self.add_attribute('embedded-link', value=i)
|
||||
else:
|
||||
|
@ -113,7 +113,7 @@ class MicroblogObject(AbstractMISPObjectGenerator):
|
|||
|
||||
# embedded-safe-link
|
||||
if self._parameters.get('embedded-safe-link'):
|
||||
if type(self._parameters.get('embedded-safe-link')) is list:
|
||||
if type(self._parameters.get('embedded-safe-link')) == list:
|
||||
for i in self._parameters.get('embedded-safe-link'):
|
||||
self.add_attribute('embedded-safe-link', value=i)
|
||||
else:
|
||||
|
@ -121,7 +121,7 @@ class MicroblogObject(AbstractMISPObjectGenerator):
|
|||
|
||||
# Hashtag into the microblog post.
|
||||
if self._parameters.get('hashtag'):
|
||||
if type(self._parameters.get('hashtag')) is list:
|
||||
if type(self._parameters.get('hashtag')) == list:
|
||||
for i in self._parameters.get('hashtag'):
|
||||
self.add_attribute('hashtag', value=i)
|
||||
else:
|
||||
|
@ -129,7 +129,7 @@ class MicroblogObject(AbstractMISPObjectGenerator):
|
|||
|
||||
# username quoted
|
||||
if self._parameters.get('username-quoted'):
|
||||
if type(self._parameters.get('username-quoted')) is list:
|
||||
if type(self._parameters.get('username-quoted')) == list:
|
||||
for i in self._parameters.get('username-quoted'):
|
||||
self.add_attribute('username-quoted', value=i)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue