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 abool
or athreading.Event
instance. AFalse
bool value there will cause the thread to finish next time it prints the status line. AnEvent
object with flag set will cause the thread to finish (using Event is recommended when thedelay
is 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
(likeB
for bytes or `` conn`` for connections).prefix (str) – controls the exponent for the SI prefix, use
decimal
for 1000 andbinary
for 1024delay (float) – sets how often to print the status line, in seconds
end (str) – line terminator to use when printing the status line, use
\r
to overwrite the line when printing (default), or\n
to print a whole new line every time.