itk-dev-shared-components 2.7.1__tar.gz → 2.8.1__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.7.1 → itk_dev_shared_components-2.8.1}/PKG-INFO +1 -1
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/eflyt/eflyt_case.py +13 -9
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/nova_cases.py +27 -4
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/misc/cpr_util.py +21 -5
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components.egg-info/PKG-INFO +1 -1
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/pyproject.toml +1 -1
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/LICENSE +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/README.md +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/__init__.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/eflyt/__init__.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/eflyt/eflyt_login.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/eflyt/eflyt_search.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/eflyt/eflyt_util.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/graph/__init__.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/graph/authentication.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/graph/common.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/graph/file.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/graph/mail.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/graph/site.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/__init__.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/authentication.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/cpr.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/nova_documents.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/nova_notes.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/nova_objects.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/nova_tasks.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/kmd_nova/util.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/misc/__init__.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/misc/address_lookup.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/misc/cvr_lookup.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/misc/file_util.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/sap/__init__.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/sap/fmcacov.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/sap/gridview_util.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/sap/multi_session.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/sap/opret_kundekontakt.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/sap/sap_login.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/sap/sap_util.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/sap/tree_util.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/smtp/__init__.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components/smtp/smtp_util.py +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components.egg-info/SOURCES.txt +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components.egg-info/requires.txt +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/itk_dev_shared_components.egg-info/top_level.txt +0 -0
- {itk_dev_shared_components-2.7.1 → itk_dev_shared_components-2.8.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: itk_dev_shared_components
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.8.1
|
|
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
|
|
@@ -130,7 +130,9 @@ def change_tab(browser: webdriver.Chrome, tab_index: int):
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
def approve_case(browser: webdriver.Chrome):
|
|
133
|
-
"""Approve a case
|
|
133
|
+
"""Approve a case.
|
|
134
|
+
If any person on the case is blocking approval, approve each person individually.
|
|
135
|
+
"""
|
|
134
136
|
change_tab(browser, 0)
|
|
135
137
|
|
|
136
138
|
deadline_field = browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_ncPersonTab_txtDeadline")
|
|
@@ -142,20 +144,22 @@ def approve_case(browser: webdriver.Chrome):
|
|
|
142
144
|
browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnApproveYes").click()
|
|
143
145
|
|
|
144
146
|
approve_persons_button = browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnGodkendAlle")
|
|
145
|
-
if
|
|
147
|
+
if approve_persons_button.is_enabled():
|
|
148
|
+
approve_persons_button.click()
|
|
149
|
+
else:
|
|
150
|
+
# Approve each person individually
|
|
151
|
+
person_count = len(browser.find_elements(By.XPATH, '//table[@id="ctl00_ContentPlaceHolder2_GridViewMovingPersons"]//tr')) - 1
|
|
146
152
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
rows.pop(0)
|
|
153
|
+
for i in range(person_count):
|
|
154
|
+
browser.find_element(By.XPATH, f'//table[@id="ctl00_ContentPlaceHolder2_GridViewMovingPersons"]//tr[{i+2}]//td[2]').click()
|
|
150
155
|
|
|
151
|
-
for row in rows:
|
|
152
|
-
row.find_element(By.XPATH, "td[2]").click()
|
|
153
156
|
browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnGodkend").click()
|
|
154
157
|
approve_button = browser.find_element(By.ID, "ctl00_ContentPlaceHolder2_ptFanePerson_stcPersonTab1_btnApproveYes")
|
|
155
158
|
if approve_button.is_displayed():
|
|
156
159
|
approve_button.click()
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
|
|
161
|
+
# Go back to the case
|
|
162
|
+
browser.find_element(By.XPATH, '//table[@id="ctl00_ContentPlaceHolder2_GridViewMovingPersons"]//tr[1]//td[2]').click()
|
|
159
163
|
|
|
160
164
|
|
|
161
165
|
def check_all_approved(browser: webdriver.Chrome) -> bool:
|
|
@@ -12,6 +12,28 @@ from itk_dev_shared_components.kmd_nova.nova_objects import NovaCase, CaseParty,
|
|
|
12
12
|
from itk_dev_shared_components.kmd_nova.util import datetime_from_iso_string
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
def get_case(case_uuid: str, nova_access: NovaAccess) -> NovaCase:
|
|
16
|
+
"""Get a case from based on its uuid.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
case_uuid: The uuid of the case to get.
|
|
20
|
+
nova_access: The NovaAccess object used to authenticate.
|
|
21
|
+
|
|
22
|
+
Raises:
|
|
23
|
+
ValueError: If no case was found.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
The case with the given uuid.
|
|
27
|
+
"""
|
|
28
|
+
payload = _create_payload(case_uuid=case_uuid)
|
|
29
|
+
cases = _get_nova_cases(nova_access, payload)
|
|
30
|
+
|
|
31
|
+
if not cases:
|
|
32
|
+
raise ValueError(f"No case found with the given uuid: {case_uuid}")
|
|
33
|
+
|
|
34
|
+
return cases[0]
|
|
35
|
+
|
|
36
|
+
|
|
15
37
|
def get_cases(nova_access: NovaAccess, cpr: str = None, case_number: str = None, case_title: str = None, limit: int = 100) -> list[NovaCase]:
|
|
16
38
|
"""Search for cases on different search terms.
|
|
17
39
|
Currently supports search on cpr number, case number and case title. At least one search term must be given.
|
|
@@ -33,7 +55,7 @@ def get_cases(nova_access: NovaAccess, cpr: str = None, case_number: str = None,
|
|
|
33
55
|
if not any((cpr, case_number, case_title)):
|
|
34
56
|
raise ValueError("No search terms given.")
|
|
35
57
|
|
|
36
|
-
payload = _create_payload(cpr, "CprNummer", case_number, case_title, limit)
|
|
58
|
+
payload = _create_payload(identification=cpr, identification_type="CprNummer", case_number=case_number, case_title=case_title, limit=limit)
|
|
37
59
|
return _get_nova_cases(nova_access, payload)
|
|
38
60
|
|
|
39
61
|
|
|
@@ -58,7 +80,7 @@ def get_cvr_cases(nova_access: NovaAccess, cvr: str = None, case_number: str =
|
|
|
58
80
|
if not any((cvr, case_number, case_title)):
|
|
59
81
|
raise ValueError("No search terms given.")
|
|
60
82
|
|
|
61
|
-
payload = _create_payload(cvr, "CvrNummer", case_number, case_title, limit)
|
|
83
|
+
payload = _create_payload(identification=cvr, identification_type="CvrNummer", case_number=case_number, case_title=case_title, limit=limit)
|
|
62
84
|
return _get_nova_cases(nova_access, payload)
|
|
63
85
|
|
|
64
86
|
|
|
@@ -113,10 +135,11 @@ def _get_nova_cases(nova_access: NovaAccess, payload: dict) -> list[NovaCase]:
|
|
|
113
135
|
return cases
|
|
114
136
|
|
|
115
137
|
|
|
116
|
-
def _create_payload(identification: str = None, identification_type: str = "CprNummer", case_number: str = None, case_title: str = None, limit: int = 100) -> dict:
|
|
138
|
+
def _create_payload(*, case_uuid: str = None, identification: str = None, identification_type: str = "CprNummer", case_number: str = None, case_title: str = None, limit: int = 100) -> dict:
|
|
117
139
|
return {
|
|
118
140
|
"common": {
|
|
119
|
-
"transactionId": str(uuid.uuid4())
|
|
141
|
+
"transactionId": str(uuid.uuid4()),
|
|
142
|
+
"uuid": case_uuid
|
|
120
143
|
},
|
|
121
144
|
"paging": {
|
|
122
145
|
"startRow": 1,
|
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
from datetime import date
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def
|
|
7
|
-
"""Get the
|
|
6
|
+
def get_birth_date(cpr: str) -> date:
|
|
7
|
+
"""Get the birth date of a person based on their cpr number
|
|
8
8
|
using the 7th digit to infer the century.
|
|
9
9
|
|
|
10
10
|
Args:
|
|
11
11
|
cpr: The cpr number in the format 'ddmmyyxxxx'.
|
|
12
|
-
current_date: The date where the age is calculated from. Defaults to the current date.
|
|
13
12
|
|
|
14
13
|
Returns:
|
|
15
|
-
The
|
|
14
|
+
The birth date based on cpr number.
|
|
16
15
|
|
|
17
16
|
Raises:
|
|
18
17
|
ValueError: If the given cpr is not in 'ddmmyyxxxx' format.
|
|
@@ -51,7 +50,24 @@ def get_age(cpr: str, current_date: date = date.today()) -> int:
|
|
|
51
50
|
else:
|
|
52
51
|
year += t[2]
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
return date(year, month, day)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def get_age(cpr: str, current_date: date = date.today()) -> int:
|
|
57
|
+
"""Get the age of a person based on their cpr number
|
|
58
|
+
using the 7th digit to infer the century.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
cpr: The cpr number in the format 'ddmmyyxxxx'.
|
|
62
|
+
current_date: The date where the age is calculated from. Defaults to the current date.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
The age in integer years based on the cpr number.
|
|
66
|
+
|
|
67
|
+
Raises:
|
|
68
|
+
ValueError: If the given cpr is not in 'ddmmyyxxxx' format.
|
|
69
|
+
"""
|
|
70
|
+
birthdate = get_birth_date(cpr)
|
|
55
71
|
|
|
56
72
|
age = current_date.year - birthdate.year - ((current_date.month, current_date.day) < (birthdate.month, birthdate.day))
|
|
57
73
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: itk_dev_shared_components
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.8.1
|
|
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
|