This also introduces a word-wrapping function that takes variable character widths into account.
36 lines
836 B
Python
36 lines
836 B
Python
import threading
|
|
import typing
|
|
|
|
|
|
class G:
|
|
"""Global state of the Benchmark Client."""
|
|
result_platform = ''
|
|
progress_status = ''
|
|
result_stats = ''
|
|
result_dict = {}
|
|
background_image_path = ""
|
|
scene_status = {}
|
|
cancel = False
|
|
|
|
cached_system_info = {}
|
|
cached_compute_devices = []
|
|
results_submitted = False
|
|
|
|
images = {}
|
|
current_progress = 0.0
|
|
progress_lock = threading.Lock()
|
|
|
|
submission_exception: typing.Optional[Exception] = None
|
|
|
|
@classmethod
|
|
def reset(cls):
|
|
"""Reset the global state."""
|
|
cls.result_platform = ''
|
|
cls.progress_status = ''
|
|
cls.result_stats = ''
|
|
cls.result_dict = {}
|
|
cls.background_image_path = ""
|
|
cls.scene_status = {}
|
|
cls.results_submitted = False
|
|
cls.submission_exception = None
|