MCPcopy
hub / github.com/smicallef/spiderfoot / __setStatus

Method __setStatus

sfscan.py:228–257  ·  view source on GitHub ↗

Set the status of the currently running scan (if any). Args: status (str): scan status started (float): timestamp at start of scan ended (float): timestamp at end of scan Raises: TypeError: arg type was invalid ValueError:

(self, status, started=None, ended=None)

Source from the content-addressed store, hash-verified

226 return self.__status
227
228 def __setStatus(self, status, started=None, ended=None):
229 """Set the status of the currently running scan (if any).
230
231 Args:
232 status (str): scan status
233 started (float): timestamp at start of scan
234 ended (float): timestamp at end of scan
235
236 Raises:
237 TypeError: arg type was invalid
238 ValueError: arg value was invalid
239 """
240 if not isinstance(status, str):
241 raise TypeError(f"status is {type(status)}; expected str()")
242
243 if status not in [
244 "INITIALIZING",
245 "STARTING",
246 "STARTED",
247 "RUNNING",
248 "ABORT-REQUESTED",
249 "ABORTED",
250 "ABORTING",
251 "FINISHED",
252 "ERROR-FAILED"
253 ]:
254 raise ValueError(f"Invalid scan status {status}")
255
256 self.__status = status
257 self.__dbh.scanInstanceSet(self.__scanId, started, ended, status)
258
259 def __startScan(self):
260 """Start running a scan.

Callers 2

__init__Method · 0.95
__startScanMethod · 0.95

Calls 1

scanInstanceSetMethod · 0.80

Tested by

no test coverage detected