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._si_prefix(count)[source]

Format the number with a SI prefix

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 a bool or a threading.Event instance. A False bool value there will cause the thread to finish next time it prints the status line. An Event object with flag set will cause the thread to finish (using Event is recommended when the delay 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 (like B for bytes or `` conn`` for connections).

  • prefix (str) – controls the exponent for the SI prefix, use decimal for 1000 and binary for 1024

  • delay (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.