labfreed 1.0.0a15__py3-none-any.whl → 1.0.0a17__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 labfreed might be problematic. Click here for more details.

labfreed/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  Python implementation of LabFREED building blocks
3
3
  '''
4
4
 
5
- __version__ = "1.0.0a15"
5
+ __version__ = "1.0.0a17"
6
6
 
7
7
  from labfreed.pac_id import * # noqa: F403
8
8
  from labfreed.pac_cat import * # noqa: F403
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import logging
3
4
  import os
4
5
  from datetime import datetime
5
6
  from typing import Optional, Tuple, List, Dict
@@ -133,12 +134,35 @@ class LocalExcelAttributeDataSource(_BaseExcelAttributeDataSource):
133
134
 
134
135
  @cached(_cache)
135
136
  def _read_rows_and_last_changed(self) -> Tuple[List[tuple], Optional[datetime]]:
136
- wb = load_workbook(filename=self._file_path, read_only=True, data_only=True)
137
- ws = wb.active
138
- rows = list(ws.iter_rows(values_only=True))
139
- last_changed = wb.properties.modified
140
- wb.close()
141
- return rows, last_changed
137
+ logging.info(f"Attempting to load workbook: {self._file_path!r}")
138
+
139
+ try:
140
+ wb = load_workbook(
141
+ filename=self._file_path,
142
+ read_only=True,
143
+ data_only=True
144
+ )
145
+ ws = wb.active
146
+ logging.info(f"Workbook opened successfully. Active sheet: {ws.title!r}")
147
+
148
+ rows = list(ws.iter_rows(values_only=True))
149
+ logging.info(f"Read {len(rows)} rows from {self._file_path!r}")
150
+
151
+ last_changed = wb.properties.modified
152
+ logging.info(f"Workbook 'modified' property: {last_changed}")
153
+
154
+ wb.close()
155
+ return rows, last_changed
156
+
157
+ except FileNotFoundError:
158
+ logging.error(f"Workbook not found at: {self._file_path!r}", exc_info=True)
159
+ raise
160
+ except PermissionError:
161
+ logging.error(f"Permission denied when accessing: {self._file_path!r}", exc_info=True)
162
+ raise
163
+ except Exception as e:
164
+ logging.exception(f"Unexpected error reading workbook {self._file_path!r}: {e}")
165
+ raise
142
166
 
143
167
 
144
168
  # # ---------------------------------------------------------------------
@@ -74,7 +74,7 @@ class ResolverConfigEntry(LabFREED_BaseModel):
74
74
 
75
75
  @model_validator(mode='after')
76
76
  def _validate_service_type(self):
77
- allowed_types = [ServiceType.ATTRIBUTE_SERVICE_GENERIC.value, ServiceType.USER_HANDOVER_GENERIC.value]
77
+ allowed_types = [ServiceType.ATTRIBUTE_SERVICE_GENERIC.value, ServiceType.USER_HANDOVER_GENERIC.value, ServiceType.ACTION_GENERIC.value]
78
78
  if self.service_type not in allowed_types:
79
79
  if isinstance(self.service_type, ServiceType):
80
80
  s= self.service_type.value
@@ -7,6 +7,7 @@ from labfreed.labfreed_infrastructure import ValidationMsgLevel, _quote_texts
7
7
  class ServiceType(Enum):
8
8
  USER_HANDOVER_GENERIC = 'userhandover-generic'
9
9
  ATTRIBUTE_SERVICE_GENERIC = 'attributes-generic'
10
+ ACTION_GENERIC = "action-generic"
10
11
 
11
12
 
12
13
  def _validate_service_name(service_name):
@@ -62,7 +63,7 @@ def _validate_service_type(service_type):
62
63
  service_type= service_type.value
63
64
  else:
64
65
  service_type= service_type
65
- allowed_types = [ServiceType.ATTRIBUTE_SERVICE_GENERIC.value, ServiceType.USER_HANDOVER_GENERIC.value]
66
+ allowed_types = [ServiceType.ATTRIBUTE_SERVICE_GENERIC.value, ServiceType.USER_HANDOVER_GENERIC.value, ServiceType.ACTION_GENERIC.value]
66
67
  if service_type not in allowed_types:
67
68
  msg_dict.append( {
68
69
  "level": ValidationMsgLevel.ERROR,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: labfreed
3
- Version: 1.0.0a15
3
+ Version: 1.0.0a17
4
4
  Summary: Python implementation of LabFREED building blocks
5
5
  Author-email: Reto Thürer <thuerer.r@buchi.com>
6
6
  Requires-Python: >=3.11
@@ -1,4 +1,4 @@
1
- labfreed/__init__.py,sha256=KcYeV-IKg3wMT_uly3-IR3OXlZrdLQS5Ip81OWnjx7s,339
1
+ labfreed/__init__.py,sha256=sobB_PG2qoDQWufbzxqtQjolcmyFZBRPKqk3tCd5gb0,339
2
2
  labfreed/labfreed_infrastructure.py,sha256=ss1PyJl-7Es-lEcxptmdYI9kDAHmh7HB_tAGkPC6UVs,10173
3
3
  labfreed/labfreed_extended/app/app_infrastructure.py,sha256=yfxPBDPatxHPrIPmpzdhQB7Yd3lIxGsm8ZXUM04N8nQ,4583
4
4
  labfreed/labfreed_extended/app/formatted_print.py,sha256=DcwWP0ix1e_wYNIdceIp6cETkJdG2DqpU8Gs3aZAL40,1930
@@ -17,7 +17,7 @@ labfreed/pac_attributes/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
17
17
  labfreed/pac_attributes/client/attribute_cache.py,sha256=ThUadWqQ5oM8DnAnvZuY4jeA3Mg06ePNEcRP5wCsadc,2222
18
18
  labfreed/pac_attributes/client/client.py,sha256=FjvyEpZEGYrZkuaQoqH9QFstrwHmrsIdaymxz8uQjwQ,7510
19
19
  labfreed/pac_attributes/pythonic/attribute_server_factory.py,sha256=3OeFjBdlMR4DMIzHVo5-A_y935e2_lOqvFCLKgxjsEY,6159
20
- labfreed/pac_attributes/pythonic/excel_attribute_data_source.py,sha256=zbsXiH9vry0ZqmPwUY_cr1t9xP4P3W5o5Khu9IE0e0I,7465
20
+ labfreed/pac_attributes/pythonic/excel_attribute_data_source.py,sha256=wHvw6oGdGT_IxdC7MbHmtQKb5jDPJggQ1UvvFPAEpHo,8349
21
21
  labfreed/pac_attributes/pythonic/py_attributes.py,sha256=vjRNjg-PpsQSaidpPtkiyQL_10dcD-9JAz89gAYMFJA,8307
22
22
  labfreed/pac_attributes/pythonic/py_dict_data_source.py,sha256=nAz6GA7Xx_0IORPPpt_Wl3sFJa1Q5Fnq5vdf1uQiJF8,531
23
23
  labfreed/pac_attributes/server/__init__.py,sha256=JvQ2kpQx62OUwP18bGhOWYU9an_nQW59Y8Lh7HyfVxY,301
@@ -37,8 +37,8 @@ labfreed/pac_id/url_serializer.py,sha256=01LB30pNMBtv2rYHsiE_4Ga2iVA515Boj4ikOIY
37
37
  labfreed/pac_id_resolver/__init__.py,sha256=RNBlrDOSR42gmSNH9wJVhK_xwEX45cvTKVgWW2bjh7Q,113
38
38
  labfreed/pac_id_resolver/cit_v1.py,sha256=JGlEH2d9awEu3HxPW7vu0uj4ZC3B02IdmFg7aJ4axQw,9833
39
39
  labfreed/pac_id_resolver/resolver.py,sha256=anqteWexD7w78wzd1TjT06enkDIU-P-7NVKNWiASXLU,4127
40
- labfreed/pac_id_resolver/resolver_config.py,sha256=2j3j5UsVoWqU9NjciN3j-Fs53diGi4FQEvoz8ng103Y,12388
41
- labfreed/pac_id_resolver/resolver_config_common.py,sha256=jzoDOxog8YW68q7vyvDGCZcVcgIzJHXlMt8KwgVnx6o,2885
40
+ labfreed/pac_id_resolver/resolver_config.py,sha256=hvi9x2o-1323FCRsUg6RG_ZuQRVLgTlYQ7owBTXhjW4,12422
41
+ labfreed/pac_id_resolver/resolver_config_common.py,sha256=JGbgT2YSBc3NQ5x9CV3diqYZgpDGWygGPd5flk4-hWk,2958
42
42
  labfreed/pac_id_resolver/services.py,sha256=vtnxLm38t4PNOf73cXh6UZOtWZZOGxfBCfXUDRxGHog,2592
43
43
  labfreed/qr/__init__.py,sha256=fdKwP6W2Js--yMbBUdn-g_2uq2VqPpfQJeDLHsMDO-Y,61
44
44
  labfreed/qr/generate_qr.py,sha256=mSt-U872O3ReHB_UdS-MzYu0wRgdlKcAOEfTxg5CLRk,16616
@@ -65,7 +65,7 @@ labfreed/well_known_keys/labfreed/well_known_keys.py,sha256=p-hXwEEIs7p2SKn9DQeL
65
65
  labfreed/well_known_keys/unece/UneceUnits.json,sha256=kwfQSp_nTuWbADfBBgqTWrvPl6XtM5SedEVLbMJrM7M,898953
66
66
  labfreed/well_known_keys/unece/__init__.py,sha256=MSP9lmjg9_D9iqG9Yq2_ajYfQSNS9wIT7FXA1c--59M,122
67
67
  labfreed/well_known_keys/unece/unece_units.py,sha256=J20d64H69qKDE3XlGdJoXIIh0G-d0jKoiIDsg9an5pk,1655
68
- labfreed-1.0.0a15.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
69
- labfreed-1.0.0a15.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
70
- labfreed-1.0.0a15.dist-info/METADATA,sha256=H4-dgXHNjGoidqKB1QKwTshKi2Pov7qhbHH8A1v3dwQ,19775
71
- labfreed-1.0.0a15.dist-info/RECORD,,
68
+ labfreed-1.0.0a17.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
69
+ labfreed-1.0.0a17.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
70
+ labfreed-1.0.0a17.dist-info/METADATA,sha256=Jar31mke8Tfi0VLd8eijEh-HM3FRqp55qgYwTk-BOKE,19775
71
+ labfreed-1.0.0a17.dist-info/RECORD,,