From f6dd65f5c792a41d3e379e641d49341302bb293c Mon Sep 17 00:00:00 2001 From: OvidiuCode Date: Mon, 26 Feb 2024 13:14:32 +0200 Subject: [PATCH] Get win version from windows.Desktop class --- conda.yaml | 2 +- tasks.py | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/conda.yaml b/conda.yaml index 8ebb3e8..c53420b 100644 --- a/conda.yaml +++ b/conda.yaml @@ -10,5 +10,5 @@ dependencies: - robocorp-truststore=0.8.0 # https://pypi.org/project/robocorp-truststore/ - pip=23.2.1 # https://pip.pypa.io/en/stable/news - pip: - - robocorp==1.4.3 # https://pypi.org/project/robocorp + - robocorp==1.6.2 # https://pypi.org/project/robocorp - robocorp-windows==1.0.1 # https://pypi.org/project/robocorp-browser diff --git a/tasks.py b/tasks.py index 05e77f3..42903c1 100644 --- a/tasks.py +++ b/tasks.py @@ -17,20 +17,6 @@ FONT_SIZE = os.getenv("NOTEPAD_FONT_SIZE", "12") -def get_win_version() -> str: - """Windows only utility which returns the current Windows major version.""" - # Windows terminal `ver` command is bugged, until that's fixed, check by build - # number. (the same applies for `platform.version()`) - WINDOWS_10_VERSION = "10" - WINDOWS_11_BUILD = 22000 - version_parts = platform.version().split(".") - major = version_parts[0] - if major == WINDOWS_10_VERSION and int(version_parts[2]) >= WINDOWS_11_BUILD: - major = "11" - - return major - - @setup def open_close_notepad(task): """Opens Notepad for automation, then closes it at the end.""" @@ -52,7 +38,7 @@ def _select_property(unique_id: str, value: str): def change_font_settings(family: str, style: str, size: str): - ver = get_win_version() # slightly different automation based on Windows version + ver = desktop.get_win_version() # slightly different automation based on Windows version # Opens the Edit menu and goes into Font. if ver == "11":