tlsfuzzer.utils.progress_report module
- tlsfuzzer.utils.progress_report._binary_prefix(count)[source]
Format the number with a binary prefix
- tlsfuzzer.utils.progress_report._done(status, event_type=<class 'threading.Event'>)[source]
Check if
status[2]doesn’t expect thread finish.
- tlsfuzzer.utils.progress_report._format_seconds(sec)[source]
Format number of seconds into a more readable string.
- tlsfuzzer.utils.progress_report._prefix_handler(count, suffix, divisor)[source]
Format the number with a given suffix and divisor
- tlsfuzzer.utils.progress_report._sanitize_args(status, prefix, delay, end)[source]
Check if params are sane and set defaults.
- tlsfuzzer.utils.progress_report._wait(status, delay, event_type=<class 'threading.Event'>)[source]
Delay execution by
delay.
- tlsfuzzer.utils.progress_report.progress_report(status, unit='', prefix='decimal', delay=None, end=None)[source]
Periodically report progress of a task in
status, a thread runner.- Parameters:
status (list) – must be a list with three elements, first two specify a fraction of completed work (i.e.
0 <= status[0]/status[1] <= 1), third specifies if the reporting process should continue running. It can either be aboolor athreading.Eventinstance. AFalsebool value there will cause the thread to finish next time it prints the status line. AnEventobject with flag set will cause the thread to finish (using Event is recommended when thedelayis long as that allows a quick and clean shutdown of the process).unit (str) – is the name of the unit of the two elements in
status(likeBfor bytes or `` conn`` for connections).prefix (str) – controls the exponent for the SI prefix, use
decimalfor 1000 andbinaryfor 1024delay (float) – sets how often to print the status line, in seconds
end (str) – line terminator to use when printing the status line, use
\rto overwrite the line when printing (default), or\nto print a whole new line every time.