isoc-ams 0.1.1__py2.py3-none-any.whl → 0.1.2__py2.py3-none-any.whl

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.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
- Firefox or Chrome Webbrowser with Webdriver (usually included) required.
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
- **Known issue: under Windows the Webdriver for Firefox may produce errors esp. when running headless. No problems encountered using the Chrome Webdriver (see below "Choosing a Webdriver). So on Windows - for now - the default Webdriver is Chrome**
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". Because of Windows problems default on Windows for now is chrome.
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:36 - INFO - START
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
@@ -0,0 +1,5 @@
1
+ isoc_ams.py,sha256=jrlY2qFp4adJRc7JDv2QlyQE4SXb70WEm-WSkE6lXVI,38023
2
+ isoc_ams-0.1.2.dist-info/licenses/LICENSE,sha256=BJcMew_kvBWHjs-_Hd_OMHnxOLmeczeT88V4gFCT21U,1067
3
+ isoc_ams-0.1.2.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
4
+ isoc_ams-0.1.2.dist-info/METADATA,sha256=VOOwPNqW_i7782x0gRCuZ5xxXjs7lkZ1b-IYl6YODNQ,11658
5
+ isoc_ams-0.1.2.dist-info/RECORD,,
isoc_ams.py CHANGED
@@ -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.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
- new_members_list = self._ams.build_members_list()
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
- for nm in new_members_list:
412
- if nm not in self._members_list:
413
- dlog(new_members_list[nm]["first name"],
414
- new_members_list[nm]["last name"],
415
- "("+nm+")",
416
- "was not deleted")
417
- not_deleted[nm] = new_members_list[nm]
418
- for nm in self._members_list:
419
- if nm not in new_members_list:
420
- dlog(self._members_list[nm]["first name"],
421
- self._members_list[nm]["last name"],
422
- "("+nm+")",
423
- "was not approved")
424
- not_approved[nm] = self._members_list[nm]
425
- new_pending_applications_list = self._ams.build_pending_applicants_list()
426
- for np in new_pending_applications_list:
427
- if np not in self._pending_applications_list:
428
- dlog(self._members_list[nm]["name"],
429
- "("+nm+")",
430
- "was not removed from pending aoolications")
431
- not_removed_from_pending[np] = new_pending_applications_list[np]
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=NoneHh,
961
+ debuglog=None,
950
962
  )
951
963
  else:
952
964
  ams = ISOC_AMS(
@@ -1,5 +0,0 @@
1
- isoc_ams.py,sha256=yCn-97ofCPsX7Ceh3I_eK9nVXNI96Tcvpb6YNPpHLQU,37412
2
- isoc_ams-0.1.1.dist-info/licenses/LICENSE,sha256=BJcMew_kvBWHjs-_Hd_OMHnxOLmeczeT88V4gFCT21U,1067
3
- isoc_ams-0.1.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
4
- isoc_ams-0.1.1.dist-info/METADATA,sha256=yRQKS5IHCMJRVG_n0LSRcRKoFq4yx2n51aQRuYpdb9Y,11501
5
- isoc_ams-0.1.1.dist-info/RECORD,,