diff --git a/src/specklepy/logging/metrics.py b/src/specklepy/logging/metrics.py index 67d684e..c69e0de 100644 --- a/src/specklepy/logging/metrics.py +++ b/src/specklepy/logging/metrics.py @@ -6,10 +6,11 @@ import platform import queue import sys import threading -from typing import Optional import requests +from specklepy.core.api.credentials import Account + """ Anonymous telemetry to help us understand how to make a better Speckle. This really helps us to deliver a better open source project and product! @@ -54,7 +55,7 @@ def enable(): TRACK = True -def set_host_app(host_app: str, host_app_version: Optional[str] = None): +def set_host_app(host_app: str, host_app_version: str | None = None): global HOST_APP, HOST_APP_VERSION HOST_APP = host_app HOST_APP_VERSION = host_app_version or HOST_APP_VERSION @@ -62,8 +63,8 @@ def set_host_app(host_app: str, host_app_version: Optional[str] = None): def track( action: str, - account=None, - custom_props: Optional[dict] = None, + account: Account | None = None, + custom_props: dict | None = None, ): if not TRACK: return @@ -91,7 +92,7 @@ def track( LOG.debug(f"Error queueing metrics request: {str(ex)}") -def initialise_tracker(account=None): +def initialise_tracker(account: Account | None = None): global METRICS_TRACKER if not METRICS_TRACKER: METRICS_TRACKER = MetricsTracker()