isoc-ams 0.1.1__tar.gz → 0.1.2__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.
Potentially problematic release.
This version of isoc-ams might be problematic. Click here for more details.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: isoc-ams
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: A Python 3 module to cope with ISOC-AMS.
|
|
5
5
|
Author-email: Klaus Birkenbihl <klaus.birkenbihl@isoc.de>
|
|
6
6
|
Maintainer: Klaus Birkenbihl
|
|
@@ -47,9 +47,12 @@ So here we go:
|
|
|
47
47
|
### Prerequisites
|
|
48
48
|
isoc-ams was tested under Linux (Ubuntu 22.04) and Windows 11.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
**While rather stable under Linux, Windows 11 produced mixed results. Under powershell you may need to set the ExecutionPolicy**
|
|
51
|
+
```
|
|
52
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
53
|
+
```
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
Firefox or Chrome Webbrowser with Webdriver (usually included) is required.
|
|
53
56
|
|
|
54
57
|
A full installation of Python 3.9+ is required.
|
|
55
58
|
|
|
@@ -69,7 +72,7 @@ You may select a Webdriver of your choice (provided it is one of "firefox" or "c
|
|
|
69
72
|
```bash
|
|
70
73
|
ISOC_AMS_WEBDRIVER=firefox
|
|
71
74
|
```
|
|
72
|
-
Recommended (and default) is "firefox".
|
|
75
|
+
Recommended (and default) is "firefox".
|
|
73
76
|
### Start execution of the module
|
|
74
77
|
So this happens if we call the module with:
|
|
75
78
|
```bash
|
|
@@ -80,9 +83,9 @@ Output:
|
|
|
80
83
|
Username:xyz
|
|
81
84
|
Password:
|
|
82
85
|
|
|
83
|
-
|
|
84
|
-
2025-07-13 19:25:54 - INFO - START
|
|
85
|
-
|
|
86
|
+
***********************************************************
|
|
87
|
+
2025-07-13 19:25:54 - INFO - START: Webdriver is firefox
|
|
88
|
+
***********************************************************
|
|
86
89
|
|
|
87
90
|
2025-07-13 19:25:54 - INFO - logging in
|
|
88
91
|
|
|
@@ -95,9 +98,9 @@ OK, probably your fault. After fixing:
|
|
|
95
98
|
Username: xxx
|
|
96
99
|
Password:
|
|
97
100
|
|
|
98
|
-
|
|
99
|
-
2025-07-13 19:26:27 - INFO - START
|
|
100
|
-
|
|
101
|
+
***********************************************************
|
|
102
|
+
2025-07-13 19:26:27 - INFO - START: Webdriver is firefox
|
|
103
|
+
***********************************************************
|
|
101
104
|
|
|
102
105
|
2025-07-13 19:26:27 - INFO - logging in
|
|
103
106
|
2025-07-13 19:26:45 - INFO - Now on Chapter Leader portal
|
|
@@ -152,9 +155,9 @@ Output:
|
|
|
152
155
|
Username: xxx
|
|
153
156
|
Password:
|
|
154
157
|
|
|
155
|
-
|
|
156
|
-
2025-07-15 10:35:57 - INFO - START DRYRUN
|
|
157
|
-
|
|
158
|
+
******************************************************************
|
|
159
|
+
2025-07-15 10:35:57 - INFO - START DRYRUN: Webdriver is firefox
|
|
160
|
+
*****************************************************************
|
|
158
161
|
|
|
159
162
|
2025-07-15 10:35:57 - INFO - logging in
|
|
160
163
|
2025-07-15 10:36:12 - INFO - Now on Chapter Leader portal
|
|
@@ -211,9 +214,9 @@ isoc_ams unleashes its full power when used as API to make things happen without
|
|
|
211
214
|
Here the output:
|
|
212
215
|
```
|
|
213
216
|
|
|
214
|
-
|
|
215
|
-
2025-07-15 14:13:
|
|
216
|
-
|
|
217
|
+
***********************************************************
|
|
218
|
+
2025-07-15 14:13:30 - INFO - START: Webdriver is firefox
|
|
219
|
+
***********************************************************
|
|
217
220
|
|
|
218
221
|
2025-07-15 14:13:36 - INFO - logging in
|
|
219
222
|
2025-07-15 14:13:53 - INFO - Now on Chapter Leader portal
|
|
@@ -35,9 +35,12 @@ So here we go:
|
|
|
35
35
|
### Prerequisites
|
|
36
36
|
isoc-ams was tested under Linux (Ubuntu 22.04) and Windows 11.
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
**While rather stable under Linux, Windows 11 produced mixed results. Under powershell you may need to set the ExecutionPolicy**
|
|
39
|
+
```
|
|
40
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
41
|
+
```
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
Firefox or Chrome Webbrowser with Webdriver (usually included) is required.
|
|
41
44
|
|
|
42
45
|
A full installation of Python 3.9+ is required.
|
|
43
46
|
|
|
@@ -57,7 +60,7 @@ You may select a Webdriver of your choice (provided it is one of "firefox" or "c
|
|
|
57
60
|
```bash
|
|
58
61
|
ISOC_AMS_WEBDRIVER=firefox
|
|
59
62
|
```
|
|
60
|
-
Recommended (and default) is "firefox".
|
|
63
|
+
Recommended (and default) is "firefox".
|
|
61
64
|
### Start execution of the module
|
|
62
65
|
So this happens if we call the module with:
|
|
63
66
|
```bash
|
|
@@ -68,9 +71,9 @@ Output:
|
|
|
68
71
|
Username:xyz
|
|
69
72
|
Password:
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
2025-07-13 19:25:54 - INFO - START
|
|
73
|
-
|
|
74
|
+
***********************************************************
|
|
75
|
+
2025-07-13 19:25:54 - INFO - START: Webdriver is firefox
|
|
76
|
+
***********************************************************
|
|
74
77
|
|
|
75
78
|
2025-07-13 19:25:54 - INFO - logging in
|
|
76
79
|
|
|
@@ -83,9 +86,9 @@ OK, probably your fault. After fixing:
|
|
|
83
86
|
Username: xxx
|
|
84
87
|
Password:
|
|
85
88
|
|
|
86
|
-
|
|
87
|
-
2025-07-13 19:26:27 - INFO - START
|
|
88
|
-
|
|
89
|
+
***********************************************************
|
|
90
|
+
2025-07-13 19:26:27 - INFO - START: Webdriver is firefox
|
|
91
|
+
***********************************************************
|
|
89
92
|
|
|
90
93
|
2025-07-13 19:26:27 - INFO - logging in
|
|
91
94
|
2025-07-13 19:26:45 - INFO - Now on Chapter Leader portal
|
|
@@ -140,9 +143,9 @@ Output:
|
|
|
140
143
|
Username: xxx
|
|
141
144
|
Password:
|
|
142
145
|
|
|
143
|
-
|
|
144
|
-
2025-07-15 10:35:57 - INFO - START DRYRUN
|
|
145
|
-
|
|
146
|
+
******************************************************************
|
|
147
|
+
2025-07-15 10:35:57 - INFO - START DRYRUN: Webdriver is firefox
|
|
148
|
+
*****************************************************************
|
|
146
149
|
|
|
147
150
|
2025-07-15 10:35:57 - INFO - logging in
|
|
148
151
|
2025-07-15 10:36:12 - INFO - Now on Chapter Leader portal
|
|
@@ -199,9 +202,9 @@ isoc_ams unleashes its full power when used as API to make things happen without
|
|
|
199
202
|
Here the output:
|
|
200
203
|
```
|
|
201
204
|
|
|
202
|
-
|
|
203
|
-
2025-07-15 14:13:
|
|
204
|
-
|
|
205
|
+
***********************************************************
|
|
206
|
+
2025-07-15 14:13:30 - INFO - START: Webdriver is firefox
|
|
207
|
+
***********************************************************
|
|
205
208
|
|
|
206
209
|
2025-07-15 14:13:36 - INFO - logging in
|
|
207
210
|
2025-07-15 14:13:53 - INFO - Now on Chapter Leader portal
|
|
@@ -87,8 +87,10 @@ CHANGELOG
|
|
|
87
87
|
minor bug fixes
|
|
88
88
|
Version 0.1.1
|
|
89
89
|
minor bug fixes
|
|
90
|
+
Version 0.1.2
|
|
91
|
+
eliminate not required checks in difference_from_expected()
|
|
90
92
|
"""
|
|
91
|
-
__version__ = "0.1.
|
|
93
|
+
__version__ = "0.1.2"
|
|
92
94
|
|
|
93
95
|
from selenium import webdriver
|
|
94
96
|
from selenium.webdriver.common.by import By
|
|
@@ -234,13 +236,13 @@ ARGUMENTS
|
|
|
234
236
|
_init_logging(logfile, debuglog)
|
|
235
237
|
self._ams = _ISOC_AMS()
|
|
236
238
|
if self._dryrun:
|
|
237
|
-
strong_msg("START DRYRUN:", "Webdriver is", _dr)
|
|
239
|
+
strong_msg("START DRYRUN:", "Version:", __version__, "Webdriver is", _dr)
|
|
238
240
|
else:
|
|
239
|
-
strong_msg("START:", "Webdriver is", _dr)
|
|
241
|
+
strong_msg("START:", "Version:", __version__, "Webdriver is", _dr)
|
|
240
242
|
self._ams.login((user, password))
|
|
241
243
|
self._members_list = self._ams.build_members_list()
|
|
242
244
|
self._pending_applications_list = self._ams.build_pending_applicants_list()
|
|
243
|
-
|
|
245
|
+
self.approve_list = self.delete_list = self.deny_list = None
|
|
244
246
|
|
|
245
247
|
@property
|
|
246
248
|
def members_list(self) -> dict:
|
|
@@ -300,6 +302,7 @@ ARGUMENTS
|
|
|
300
302
|
"""
|
|
301
303
|
if type(delete_list) in (str, int):
|
|
302
304
|
delete_list = [delete_list]
|
|
305
|
+
self.delete_list = delete_list
|
|
303
306
|
for deletee in map(str, delete_list):
|
|
304
307
|
if deletee in self._members_list:
|
|
305
308
|
deletee = str(deletee)
|
|
@@ -327,6 +330,7 @@ ARGUMENTS
|
|
|
327
330
|
"""
|
|
328
331
|
if type(approve_list) in (int, str):
|
|
329
332
|
approve_list = [approve_list]
|
|
333
|
+
self.approve_list = approve_list
|
|
330
334
|
for approvee in map(str, approve_list):
|
|
331
335
|
if approvee in self._pending_applications_list:
|
|
332
336
|
if approvee not in self._members_list:
|
|
@@ -360,6 +364,7 @@ ARGUMENTS
|
|
|
360
364
|
"""
|
|
361
365
|
if type(deny_list) in (str, int):
|
|
362
366
|
deny_list = [deny_list],
|
|
367
|
+
self.deny_list = deny_list
|
|
363
368
|
for denyee in map(str, deny_list):
|
|
364
369
|
if denyee in self._pending_applications_list:
|
|
365
370
|
if not self._dryrun:
|
|
@@ -406,29 +411,36 @@ RETURNS
|
|
|
406
411
|
not_deleted = {}
|
|
407
412
|
not_approved = {}
|
|
408
413
|
not_removed_from_pending = {}
|
|
409
|
-
|
|
414
|
+
|
|
415
|
+
if self.approve_list or self.delete_list:
|
|
416
|
+
new_members_list = self._ams.build_members_list()
|
|
417
|
+
if self.deny_list or self.approve_list:
|
|
418
|
+
new_pending_applications_list = self._ams.build_pending_applicants_list()
|
|
419
|
+
|
|
410
420
|
dlog("Check members list")
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
421
|
+
if self.delete_list:
|
|
422
|
+
for nm in new_members_list:
|
|
423
|
+
if nm not in self._members_list:
|
|
424
|
+
dlog(new_members_list[nm]["first name"],
|
|
425
|
+
new_members_list[nm]["last name"],
|
|
426
|
+
"("+nm+")",
|
|
427
|
+
"was not deleted")
|
|
428
|
+
not_deleted[nm] = new_members_list[nm]
|
|
429
|
+
if self.approve_list:
|
|
430
|
+
for nm in self._members_list:
|
|
431
|
+
if nm not in new_members_list:
|
|
432
|
+
dlog(self._members_list[nm]["first name"],
|
|
433
|
+
self._members_list[nm]["last name"],
|
|
434
|
+
"("+nm+")",
|
|
435
|
+
"was not approved")
|
|
436
|
+
not_approved[nm] = self._members_list[nm]
|
|
437
|
+
if self.deny_list:
|
|
438
|
+
for np in new_pending_applications_list:
|
|
439
|
+
if np not in self._pending_applications_list:
|
|
440
|
+
dlog(self._members_list[nm]["name"],
|
|
441
|
+
"("+nm+")",
|
|
442
|
+
"was not removed from pending aoolications")
|
|
443
|
+
not_removed_from_pending[np] = new_pending_applications_list[np]
|
|
432
444
|
|
|
433
445
|
result = {}
|
|
434
446
|
if not_deleted:
|
|
@@ -946,7 +958,7 @@ if __name__ == "__main__":
|
|
|
946
958
|
headless=headless,
|
|
947
959
|
dryrun=dryrun,
|
|
948
960
|
logfile=sys.stdout,
|
|
949
|
-
debuglog=
|
|
961
|
+
debuglog=None,
|
|
950
962
|
)
|
|
951
963
|
else:
|
|
952
964
|
ams = ISOC_AMS(
|
|
File without changes
|
|
File without changes
|