ITK-dev-shared-components 2.17.1__tar.gz → 2.17.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/PKG-INFO +1 -1
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/boliglaan/login.py +2 -2
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/boliglaan/search/search_advis.py +23 -15
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/eflyt/eflyt_case.py +36 -17
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/nova_notes.py +2 -1
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components.egg-info/PKG-INFO +1 -1
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/pyproject.toml +1 -1
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/LICENSE +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/README.md +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/boliglaan/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/boliglaan/common.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/boliglaan/search/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/eflyt/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/eflyt/eflyt_letter.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/eflyt/eflyt_login.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/eflyt/eflyt_search.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/eflyt/eflyt_util.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/getorganized/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/getorganized/go_api.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/graph/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/graph/authentication.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/graph/common.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/graph/file.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/graph/mail.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/graph/site.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/authentication.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/cpr.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/nova_cases.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/nova_documents.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/nova_objects.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/nova_tasks.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/kmd_nova/util.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/misc/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/misc/address_lookup.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/misc/cpr_util.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/misc/cvr_lookup.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/misc/file_util.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/sap/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/sap/fmcacov.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/sap/gridview_util.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/sap/multi_session.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/sap/opret_kundekontakt.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/sap/sap_login.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/sap/sap_util.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/sap/tree_util.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/smtp/__init__.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components/smtp/smtp_util.py +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components.egg-info/SOURCES.txt +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components.egg-info/requires.txt +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/itk_dev_shared_components.egg-info/top_level.txt +0 -0
- {itk_dev_shared_components-2.17.1 → itk_dev_shared_components-2.17.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: itk_dev_shared_components
|
|
3
|
-
Version: 2.17.
|
|
3
|
+
Version: 2.17.4
|
|
4
4
|
Summary: Shared components to use in RPA projects
|
|
5
5
|
Author-email: ITK Development <itk-rpa@mkb.aarhus.dk>
|
|
6
6
|
Project-URL: Homepage, https://github.com/itk-dev-rpa/itk-dev-shared-components
|
|
@@ -27,8 +27,8 @@ def login(username: str, password: str):
|
|
|
27
27
|
kmd_logon.ButtonControl(AutomationId="UserPwLogonButton").GetInvokePattern().Invoke()
|
|
28
28
|
|
|
29
29
|
boliglaan = uiautomation.WindowControl(Name="KMD Boliglån", searchDepth=1)
|
|
30
|
-
if not boliglaan.Exists(maxSearchSeconds=
|
|
31
|
-
raise RuntimeError("Boliglån didn't appear within
|
|
30
|
+
if not boliglaan.Exists(maxSearchSeconds=60):
|
|
31
|
+
raise RuntimeError("Boliglån didn't appear within 60 seconds")
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
def kill_boliglaan():
|
|
@@ -4,7 +4,7 @@ and handling the advis search results.
|
|
|
4
4
|
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from datetime import date
|
|
7
|
-
from typing import Literal
|
|
7
|
+
from typing import Any, Literal
|
|
8
8
|
|
|
9
9
|
import uiautomation
|
|
10
10
|
|
|
@@ -70,20 +70,21 @@ def search_advis(cpr: str | None = None, date_from: date | None = None, date_to:
|
|
|
70
70
|
for type_ in types:
|
|
71
71
|
popup.CheckBoxControl(Name=type_).GetTogglePattern().SetToggleState(1, waitTime=0)
|
|
72
72
|
|
|
73
|
-
popup.ButtonControl(Name="Søg").
|
|
73
|
+
popup.ButtonControl(Name="Søg").Click(simulateMove=False)
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
def select_advis(cpr: str, case_number: str):
|
|
77
77
|
"""Select the advis from the search list with the given cpr and case number."""
|
|
78
78
|
boliglaan = common.get_boliglaan()
|
|
79
|
-
|
|
79
|
+
grid = boliglaan.TabControl(Name="TabbedGroup", searchDepth=4).GroupControl(Name="Advis").DataGridControl(AutomationId="AdvisGridControl")
|
|
80
|
+
grid_pattern = grid.GetGridPattern()
|
|
80
81
|
|
|
81
|
-
for row in
|
|
82
|
-
row_case_number = row
|
|
83
|
-
case_cpr = row
|
|
82
|
+
for row in range(grid_pattern.RowCount):
|
|
83
|
+
row_case_number = _get_grid_value(grid_pattern, row, 1)
|
|
84
|
+
case_cpr = _get_grid_value(grid_pattern, row, 2)
|
|
84
85
|
|
|
85
86
|
if case_cpr == cpr and row_case_number == case_number:
|
|
86
|
-
row.DoubleClick(simulateMove=False)
|
|
87
|
+
grid_pattern.GetItem(row, 0).DoubleClick(simulateMove=False)
|
|
87
88
|
return
|
|
88
89
|
|
|
89
90
|
raise LookupError(f"Couldn't find advis: {cpr} - {case_number}")
|
|
@@ -92,17 +93,19 @@ def select_advis(cpr: str, case_number: str):
|
|
|
92
93
|
def get_advis_list() -> list[Advis]:
|
|
93
94
|
"""Get the advis search result as a list of Advis objects."""
|
|
94
95
|
boliglaan = common.get_boliglaan()
|
|
95
|
-
|
|
96
|
+
|
|
97
|
+
grid = boliglaan.TabControl(Name="TabbedGroup", searchDepth=4).GroupControl(Name="Advis").DataGridControl(AutomationId="AdvisGridControl")
|
|
98
|
+
grid_pattern = grid.GetGridPattern()
|
|
96
99
|
|
|
97
100
|
result = []
|
|
98
101
|
|
|
99
|
-
for row in
|
|
100
|
-
date_str: str = row
|
|
101
|
-
case_number = row
|
|
102
|
-
cpr = row
|
|
103
|
-
type_ = row
|
|
104
|
-
state = row
|
|
105
|
-
case_type = row
|
|
102
|
+
for row in range(grid_pattern.RowCount):
|
|
103
|
+
date_str: str = _get_grid_value(grid_pattern, row, 0)
|
|
104
|
+
case_number = _get_grid_value(grid_pattern, row, 1)
|
|
105
|
+
cpr = _get_grid_value(grid_pattern, row, 2)
|
|
106
|
+
type_ = _get_grid_value(grid_pattern, row, 3)
|
|
107
|
+
state = _get_grid_value(grid_pattern, row, 4)
|
|
108
|
+
case_type = _get_grid_value(grid_pattern, row, 6)
|
|
106
109
|
|
|
107
110
|
day, month, year = (int(part) for part in date_str.split("-"))
|
|
108
111
|
date_ = date(year, month, day)
|
|
@@ -110,3 +113,8 @@ def get_advis_list() -> list[Advis]:
|
|
|
110
113
|
result.append(Advis(date=date_, cpr=cpr, case_number=case_number, type=type_, state=state, case_type=case_type))
|
|
111
114
|
|
|
112
115
|
return result
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _get_grid_value(grid_pattern: uiautomation.GridPattern, row: int, column: int) -> Any:
|
|
119
|
+
"""Helper function to get the value of a grid item."""
|
|
120
|
+
return grid_pattern.GetItem(row, column).GetPattern(uiautomation.PatternId.ValuePattern).Value
|
|
@@ -5,6 +5,11 @@ from datetime import date, datetime
|
|
|
5
5
|
from selenium import webdriver
|
|
6
6
|
from selenium.webdriver.common.by import By
|
|
7
7
|
from selenium.webdriver.common.keys import Keys
|
|
8
|
+
from selenium.webdriver.support.ui import WebDriverWait
|
|
9
|
+
from selenium.webdriver.support import expected_conditions as EC
|
|
10
|
+
from selenium.common.exceptions import TimeoutException
|
|
11
|
+
|
|
12
|
+
WAIT_TIMEOUT = 10 # Seconds to wait for ASP.NET postbacks in approve_case.
|
|
8
13
|
|
|
9
14
|
|
|
10
15
|
@dataclass
|
|
@@ -131,23 +136,34 @@ def change_tab(browser: webdriver.Chrome, tab_index: int):
|
|
|
131
136
|
|
|
132
137
|
|
|
133
138
|
def approve_case(browser: webdriver.Chrome):
|
|
134
|
-
"""Approve a case
|
|
135
|
-
|
|
139
|
+
"""Approve a case, including cases where the anmeldelse is already approved and only the
|
|
140
|
+
persons remain. Uses waits around the ASP.NET postbacks to avoid stale/not-interactable
|
|
141
|
+
races. If any person on the case is blocking approval, approve each person individually.
|
|
136
142
|
"""
|
|
137
143
|
change_tab(browser, 0)
|
|
138
144
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_ncPersonTab_txtDeadline").clear()
|
|
146
|
+
browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_ncPersonTab_txtDeadlineNote").clear()
|
|
147
|
+
|
|
148
|
+
# 1. Approve the anmeldelse only if that step is available (skip if already approved).
|
|
149
|
+
godkend = browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnGodkend")
|
|
150
|
+
if godkend.is_enabled():
|
|
151
|
+
godkend.click()
|
|
152
|
+
# 2. Confirm OK only if the confirmation dialog actually appears.
|
|
153
|
+
try:
|
|
154
|
+
WebDriverWait(browser, WAIT_TIMEOUT).until(
|
|
155
|
+
EC.element_to_be_clickable((By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnApproveYes"))
|
|
156
|
+
).click()
|
|
157
|
+
except TimeoutException:
|
|
158
|
+
pass
|
|
159
|
+
|
|
160
|
+
# 3. Approve the persons; clickability decides bulk vs per-person and waits out the
|
|
161
|
+
# postback (no is_enabled() on a stale element).
|
|
162
|
+
try:
|
|
163
|
+
WebDriverWait(browser, WAIT_TIMEOUT).until(
|
|
164
|
+
EC.element_to_be_clickable((By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnGodkendAlle"))
|
|
165
|
+
).click()
|
|
166
|
+
except TimeoutException:
|
|
151
167
|
# Approve each person individually
|
|
152
168
|
person_count = len(browser.find_elements(By.XPATH, '//table[@id="ctl00_ContentPlaceHolder2_GridViewMovingPersons"]//tr')) - 1
|
|
153
169
|
|
|
@@ -155,9 +171,12 @@ def approve_case(browser: webdriver.Chrome):
|
|
|
155
171
|
browser.find_element(By.XPATH, f'//table[@id="ctl00_ContentPlaceHolder2_GridViewMovingPersons"]//tr[{i+2}]//td[2]').click()
|
|
156
172
|
|
|
157
173
|
browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnGodkend").click()
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
174
|
+
try:
|
|
175
|
+
WebDriverWait(browser, WAIT_TIMEOUT).until(
|
|
176
|
+
EC.element_to_be_clickable((By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnApproveYes"))
|
|
177
|
+
).click()
|
|
178
|
+
except TimeoutException:
|
|
179
|
+
pass
|
|
161
180
|
|
|
162
181
|
# Go back to the case
|
|
163
182
|
browser.find_element(By.XPATH, '//table[@id="ctl00_ContentPlaceHolder2_GridViewMovingPersons"]//tr[1]//td[2]').click()
|
|
@@ -133,7 +133,8 @@ def get_notes(case_uuid: str, nova_access: NovaAccess, offset: int = 0, limit: i
|
|
|
133
133
|
response = requests.put(url, params=params, headers=headers, json=payload, timeout=60)
|
|
134
134
|
response.raise_for_status()
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
case = response.json()['cases'][0]
|
|
137
|
+
note_dicts = case.get('journalNotes', {}).get('journalNotes', [])
|
|
137
138
|
|
|
138
139
|
notes_list = []
|
|
139
140
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: itk_dev_shared_components
|
|
3
|
-
Version: 2.17.
|
|
3
|
+
Version: 2.17.4
|
|
4
4
|
Summary: Shared components to use in RPA projects
|
|
5
5
|
Author-email: ITK Development <itk-rpa@mkb.aarhus.dk>
|
|
6
6
|
Project-URL: Homepage, https://github.com/itk-dev-rpa/itk-dev-shared-components
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|