main_server module¶
-
main_server.check_for_nodes()¶
-
main_server.distribute_files(mode='a', wait=False)¶ Sends the name of the files to be analyzed to the nodes.
- Parameters
download – (opt) If true, the repository will be downloaded. If false, it will be analyzed.
mode – The type of distribution. This can either be ‘a’ (analyze), ‘d’ (download) or ‘ad’/’da’ (both).
-
main_server.listen(mode)¶ Listens for incoming messages, e.g. from the nodes.
-
main_server.oprint(text, end='\n', file=<colorama.ansitowin32.StreamWrapper object>)¶
-
main_server.proceed_analyzed_message(message)¶ Handles an incoming ANALYZED message. The results will be decoded and stored to the database.
- Parameters
message – The message.
-
main_server.proceed_downloaded_message(message, mode)¶ Handles an incoming DOWNLOADED message. The now downloaded file will be removed from the list of pending files.
- Parameters
message – The message.
mode – The mode of the process (download, analyze, both)
-
main_server.proceed_status_message(message, print_message=False)¶ Handles an incoming STATUS message. The status information will be stored to the database.
- Parameters
message – The message.
print_message – (opt) Whether or not the status information shall be printed. (Default: False)
-
main_server.request_statuses(mode)¶ Requests the status information for all node servers.
-
main_server.send_ids(node)¶
-
main_server.send_ids_broadcast()¶ Informs the nodes about their UUIDs and the UUID of the repository to analyze.
-
main_server.start(repo_uuid, mode, wait=False)¶ Starts the master server.
- Parameters
repo_uuid – The UUID of the repository.
mode – The mode.
wait – Whether the function should run synchronously (True) or threaded (False).