ITK-dev-shared-components 2.3.0__tar.gz → 2.4.0__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.3.0 → itk_dev_shared_components-2.4.0}/PKG-INFO +5 -1
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/graph/file.py +5 -1
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/nova_cases.py +2 -2
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/nova_notes.py +9 -2
- itk_dev_shared_components-2.4.0/itk_dev_shared_components/misc/file_util.py +33 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components.egg-info/PKG-INFO +5 -1
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components.egg-info/SOURCES.txt +1 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components.egg-info/requires.txt +5 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/pyproject.toml +9 -2
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/LICENSE +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/README.md +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/__init__.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/graph/__init__.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/graph/authentication.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/graph/common.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/graph/mail.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/graph/site.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/__init__.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/authentication.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/cpr.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/nova_documents.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/nova_objects.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/nova_tasks.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/kmd_nova/util.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/misc/__init__.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/misc/cpr_util.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/sap/__init__.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/sap/fmcacov.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/sap/gridview_util.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/sap/multi_session.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/sap/opret_kundekontakt.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/sap/sap_login.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/sap/sap_util.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/sap/tree_util.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/smtp/__init__.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components/smtp/smtp_util.py +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/itk_dev_shared_components.egg-info/top_level.txt +0 -0
- {itk_dev_shared_components-2.3.0 → itk_dev_shared_components-2.4.0}/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.4.0
|
|
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
|
|
@@ -15,6 +15,10 @@ Requires-Dist: pywin32>=306
|
|
|
15
15
|
Requires-Dist: msal>=1.24.1
|
|
16
16
|
Requires-Dist: requests>=2.31.0
|
|
17
17
|
Requires-Dist: beautifulsoup4>=4.12.2
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: python-dotenv; extra == "dev"
|
|
20
|
+
Requires-Dist: flake8; extra == "dev"
|
|
21
|
+
Requires-Dist: pylint; extra == "dev"
|
|
18
22
|
|
|
19
23
|
# itk-dev-shared-components
|
|
20
24
|
|
|
@@ -16,7 +16,7 @@ class DriveItem:
|
|
|
16
16
|
last_modified: str
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
def get_drive_item(graph_access: GraphAccess, site_id: str, drive_item_path: str) ->
|
|
19
|
+
def get_drive_item(graph_access: GraphAccess, site_id: str, drive_item_path: str) -> DriveItem:
|
|
20
20
|
"""Given a site id and a drive_item_path, gets the corresponding DriveItem
|
|
21
21
|
|
|
22
22
|
You need to authorize against Graph to get the GraphAccess before using this function
|
|
@@ -28,7 +28,11 @@ def get_drive_item(graph_access: GraphAccess, site_id: str, drive_item_path: str
|
|
|
28
28
|
graph_access: The GraphAccess object used to authenticate.
|
|
29
29
|
site_id: The id of the site in SharePoint.
|
|
30
30
|
drive_item_path: The path to the DriveItem in SharePoint.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
DriveItem: A DriveItem object.
|
|
31
34
|
"""
|
|
35
|
+
|
|
32
36
|
endpoint = f"https://graph.microsoft.com/v1.0/sites/{site_id}/drive/root:/{drive_item_path}"
|
|
33
37
|
response = get_request(endpoint, graph_access)
|
|
34
38
|
raw_response = response.json()
|
|
@@ -338,8 +338,8 @@ def add_case(case: NovaCase, nova_access: NovaAccess):
|
|
|
338
338
|
}
|
|
339
339
|
},
|
|
340
340
|
"SensitivityCtrlBy": "Bruger",
|
|
341
|
-
"SecurityUnitCtrlBy": "
|
|
342
|
-
"ResponsibleDepartmentCtrlBy": "
|
|
341
|
+
"SecurityUnitCtrlBy": "Bruger",
|
|
342
|
+
"ResponsibleDepartmentCtrlBy": "Bruger",
|
|
343
343
|
"caseAvailability": {
|
|
344
344
|
"unit": "År",
|
|
345
345
|
"scale": 5
|
|
@@ -8,10 +8,10 @@ from datetime import datetime
|
|
|
8
8
|
import requests
|
|
9
9
|
|
|
10
10
|
from itk_dev_shared_components.kmd_nova.authentication import NovaAccess
|
|
11
|
-
from itk_dev_shared_components.kmd_nova.nova_objects import JournalNote
|
|
11
|
+
from itk_dev_shared_components.kmd_nova.nova_objects import JournalNote, Caseworker
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def add_text_note(case_uuid: str, note_title: str, note_text: str, approved: bool, nova_access: NovaAccess) -> str:
|
|
14
|
+
def add_text_note(case_uuid: str, note_title: str, note_text: str, caseworker: Caseworker, approved: bool, nova_access: NovaAccess) -> str:
|
|
15
15
|
"""Add a text based journal note to a Nova case.
|
|
16
16
|
|
|
17
17
|
Args:
|
|
@@ -40,6 +40,13 @@ def add_text_note(case_uuid: str, note_title: str, note_text: str, approved: boo
|
|
|
40
40
|
"approved": approved,
|
|
41
41
|
"journalNoteAttributes": {
|
|
42
42
|
"journalNoteDate": datetime.today().isoformat(),
|
|
43
|
+
"journalNoteAuthor": caseworker.ident,
|
|
44
|
+
"author": {
|
|
45
|
+
"kspIdentity": {
|
|
46
|
+
"racfId": caseworker.ident,
|
|
47
|
+
"fullName": caseworker.name
|
|
48
|
+
}
|
|
49
|
+
},
|
|
43
50
|
"title": note_title,
|
|
44
51
|
"journalNoteType": "Bruger",
|
|
45
52
|
"format": "Text",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""This module contains helper functions to do with handling files."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def wait_for_download(folder: str, file_name: str | None, file_extension: str, timeout: int = 10) -> str:
|
|
8
|
+
"""Wait for a file to appear in a folder.
|
|
9
|
+
This checks the folder every second for the file.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
folder: The absolute path of the folder to monitor.
|
|
13
|
+
file_name: The name of the file if know else None
|
|
14
|
+
file_extension: The file extension of the file with the dot.
|
|
15
|
+
timeout: The number of seconds to wait for the file.
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
The absolute path to the file.
|
|
19
|
+
|
|
20
|
+
Raises:
|
|
21
|
+
TimeoutError: If the file didn't appear withing the given timeout.
|
|
22
|
+
"""
|
|
23
|
+
for _ in range(timeout):
|
|
24
|
+
files = os.listdir(folder)
|
|
25
|
+
for file in files:
|
|
26
|
+
name, ext = os.path.splitext(file)
|
|
27
|
+
|
|
28
|
+
if file_extension == ext and (file_name is None or file_name == name):
|
|
29
|
+
return os.path.join(folder, file)
|
|
30
|
+
|
|
31
|
+
time.sleep(1)
|
|
32
|
+
|
|
33
|
+
raise TimeoutError(f"Downloaded file didn't appear within {timeout} seconds.")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: itk_dev_shared_components
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
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
|
|
@@ -15,6 +15,10 @@ Requires-Dist: pywin32>=306
|
|
|
15
15
|
Requires-Dist: msal>=1.24.1
|
|
16
16
|
Requires-Dist: requests>=2.31.0
|
|
17
17
|
Requires-Dist: beautifulsoup4>=4.12.2
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: python-dotenv; extra == "dev"
|
|
20
|
+
Requires-Dist: flake8; extra == "dev"
|
|
21
|
+
Requires-Dist: pylint; extra == "dev"
|
|
18
22
|
|
|
19
23
|
# itk-dev-shared-components
|
|
20
24
|
|
|
@@ -24,6 +24,7 @@ itk_dev_shared_components/kmd_nova/nova_tasks.py
|
|
|
24
24
|
itk_dev_shared_components/kmd_nova/util.py
|
|
25
25
|
itk_dev_shared_components/misc/__init__.py
|
|
26
26
|
itk_dev_shared_components/misc/cpr_util.py
|
|
27
|
+
itk_dev_shared_components/misc/file_util.py
|
|
27
28
|
itk_dev_shared_components/sap/__init__.py
|
|
28
29
|
itk_dev_shared_components/sap/fmcacov.py
|
|
29
30
|
itk_dev_shared_components/sap/gridview_util.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "itk_dev_shared_components"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.4.0"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="ITK Development", email="itk-rpa@mkb.aarhus.dk" },
|
|
10
10
|
]
|
|
@@ -20,9 +20,16 @@ dependencies = [
|
|
|
20
20
|
"pywin32 >= 306",
|
|
21
21
|
"msal >= 1.24.1",
|
|
22
22
|
"requests >= 2.31.0",
|
|
23
|
-
"beautifulsoup4 >= 4.12.2"
|
|
23
|
+
"beautifulsoup4 >= 4.12.2",
|
|
24
24
|
]
|
|
25
25
|
|
|
26
26
|
[project.urls]
|
|
27
27
|
"Homepage" = "https://github.com/itk-dev-rpa/itk-dev-shared-components"
|
|
28
28
|
"Bug Tracker" = "https://github.com/itk-dev-rpa/itk-dev-shared-components/issues"
|
|
29
|
+
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
dev = [
|
|
32
|
+
"python-dotenv",
|
|
33
|
+
"flake8",
|
|
34
|
+
"pylint"
|
|
35
|
+
]
|
|
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
|