Skip to content

systemdiag

Session diagnostics.

Attributes

mlogger = get_logger(__name__) module-attribute

Functions

check_min_host_version()

Source code in pyrevitlib/pyrevit/loader/systemdiag.py
def check_min_host_version():
    # get required version and build from user config
    req_build = user_config.required_host_build
    if req_build:
        if HOST_APP.build != req_build:
            mlogger.warning('You are not using the required host build: %s',
                            req_build)

check_host_drive_freespace()

Source code in pyrevitlib/pyrevit/loader/systemdiag.py
def check_host_drive_freespace():
    # get min free space from user config
    min_freespace = user_config.min_host_drivefreespace
    if min_freespace:
        # find host drive and check free space
        host_drive = Path.GetPathRoot(HOST_APP.proc_path)
        for drive in DriveInfo.GetDrives():
            if drive.Name == host_drive:
                free_hd_space = float(drive.TotalFreeSpace) / (1024 ** 3)

                if free_hd_space < min_freespace:
                    mlogger.warning('Remaining space on local drive '
                                    'is less than %sGB...', min_freespace)

system_diag()

Verifies system status is appropriate for a pyRevit session.

Source code in pyrevitlib/pyrevit/loader/systemdiag.py
def system_diag():
    """Verifies system status is appropriate for a pyRevit session."""
    # checking available drive space
    check_host_drive_freespace()

    # check if user is running the required host version and build
    check_min_host_version()