8000 Get win version from windows.Desktop class · robocorp/example-windows-notepad@f6dd65f · GitHub
[go: up one dir, main page]

Skip to content

Commit f6dd65f

Browse files
committed
Get win version from windows.Desktop class
1 parent 1decce8 commit f6dd65f

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

conda.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ dependencies:
1010
- robocorp-truststore=0.8.0 # https://pypi.org/project/robocorp-truststore/
1111
- pip=23.2.1 # https://pip.pypa.io/en/stable/news
1212
- pip:
13-
- robocorp==1.4.3 # https://pypi.org/project/robocorp
13+
- robocorp==1.6.2 # https://pypi.org/project/robocorp
1414
- robocorp-windows==1.0.1 # https://pypi.org/project/robocorp-browser

tasks.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@
1717
FONT_SIZE = os.getenv("NOTEPAD_FONT_SIZE", "12")
1818

1919

20-
def get_win_version() -> str:
21-
"""Windows only utility which returns the current Windows major version."""
22-
# Windows terminal `ver` command is bugged, until that's fixed, check by build
23-
# number. (the same applies for `platform.version()`)
24-
WINDOWS_10_VERSION = "10"
25-
WINDOWS_11_BUILD = 22000
26-
version_parts = platform.version().split(".")
27-
major = version_parts[0]
28-
if major == WINDOWS_10_VERSION and int(version_parts[2]) >= WINDOWS_11_BUILD:
29-
major = "11"
30-
31-
return major
32-
33-
3420
@setup
3521
def open_close_notepad(task):
3622
"""Opens Notepad for automation, then closes it at the end."""
@@ -52,7 +38,7 @@ def _select_property(unique_id: str, value: str):
5238

5339

5440
def change_font_settings(family: str, style: str, size: str):
55-
ver = get_win_version() # slightly different automation based on Windows version
41+
ver = desktop.get_win_version() # slightly different automation based on Windows version
5642

5743
# Opens the Edit menu and goes into Font.
5844
if ver == "11":

0 commit comments

Comments
 (0)
0