bfabric-web-apps 0.2.0__py3-none-any.whl → 0.2.1__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.
@@ -88,7 +88,8 @@ class BfabricInterface( Bfabric ):
88
88
  if current_time > datetime.datetime.strptime(expiry_time, "%Y-%m-%d %H:%M:%S") + datetime.timedelta(days=7):
89
89
  return "EXPIRED"
90
90
 
91
- environment_dict = {"Production":"https://fgcz-bfabric.uzh.ch/bfabric","Test":"https://fgcz-bfabric-test.uzh.ch/bfabric"}
91
+ envioronment_name = str(userinfo['environment']).strip().lower()
92
+ environment_dict = {"production":"https://fgcz-bfabric.uzh.ch/bfabric","prod":"https://fgcz-bfabric.uzh.ch/bfabric","test":"https://fgcz-bfabric-test.uzh.ch/bfabric"}
92
93
 
93
94
  token_data = dict(
94
95
  environment = userinfo['environment'],
@@ -96,7 +97,7 @@ class BfabricInterface( Bfabric ):
96
97
  token_expires = expiry_time,
97
98
  entity_id_data = userinfo['entityId'],
98
99
  entityClass_data = userinfo['entityClassName'],
99
- webbase_data = environment_dict.get(userinfo['environment'], None),
100
+ webbase_data = environment_dict[envioronment_name],
100
101
  application_params_data = {},
101
102
  application_data = str(userinfo['applicationId']),
102
103
  userWsPassword = userinfo['userWsPassword'],
@@ -129,10 +130,9 @@ class BfabricInterface( Bfabric ):
129
130
  Returns:
130
131
  Bfabric: An authenticated Bfabric instance.
131
132
  """
132
-
133
+
133
134
  bfabric_auth = BfabricAuth(login=token_response.get('user_data'), password=token_response.get('userWsPassword'))
134
- bfabric_client_config = BfabricClientConfig(base_url=token_response.get('webbase_data'))
135
-
135
+ bfabric_client_config = BfabricClientConfig(base_url=token_response['webbase_data'])
136
136
  bfabric_wrapper = bfabric.Bfabric(config=bfabric_client_config, auth=bfabric_auth)
137
137
 
138
138
  return bfabric_wrapper
@@ -211,6 +211,8 @@ def save_files_from_bytes(files_as_byte_strings: dict, logger):
211
211
  for destination, file_bytes in files_as_byte_strings.items():
212
212
  try:
213
213
  # Write file from byte string
214
+ if destination.startswith("~"):
215
+ destination = os.path.expanduser(destination)
214
216
  with open(destination, "+wb") as f:
215
217
  f.write(file_bytes)
216
218
  logger.log_operation("File saved | ORIGIN: run_main_job function", f"File {destination} saved successfully.", params=None, flush_logs=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bfabric-web-apps
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: A package containing handy boilerplate utilities for developing bfabric web-applications
5
5
  Author: Marc Zuber, Griffin White, GWC GmbH
6
6
  Requires-Python: >=3.10,<4.0
@@ -1,6 +1,6 @@
1
1
  bfabric_web_apps/__init__.py,sha256=eRYBvXrDM8Bhdm7cbI80L1hjtbRFqUasJiBW52Hx3TI,1715
2
2
  bfabric_web_apps/layouts/layouts.py,sha256=z8gL4n4wwLdpLGomO9CftBLnGpc3r6OpmUc2-wBg8uo,14661
3
- bfabric_web_apps/objects/BfabricInterface.py,sha256=cEUcAdr4iUH8aS2VGe3CFnAbNQiTj13hYuSVcDg725A,10646
3
+ bfabric_web_apps/objects/BfabricInterface.py,sha256=iz3m3SXtUVaEMm0ZRm-2IFePd2UkVu1ob87mq1ogLXA,10751
4
4
  bfabric_web_apps/objects/Logger.py,sha256=62LC94xhm7YG5LUw3yH46NqvJQsAX7wnc9D4zbY16rA,5224
5
5
  bfabric_web_apps/utils/app_init.py,sha256=RCdpCXp19cF74bouYJLPe-KSETZ0Vwqtd02Ta2VXEF8,428
6
6
  bfabric_web_apps/utils/callbacks.py,sha256=tB1xtHl_ePY6KJWNz3erkrZw3HFhRneewGqZm9xIYtI,12687
@@ -15,8 +15,8 @@ bfabric_web_apps/utils/redis_connection.py,sha256=qXSPxW6m55Ogv44BhmPCl9ACuvzmpf
15
15
  bfabric_web_apps/utils/redis_queue.py,sha256=MCx7z_I2NusJ4P42mcLvV7STtXBFMIIvun83fM8zOGI,168
16
16
  bfabric_web_apps/utils/redis_worker_init.py,sha256=wtjQL48PLNXD1s-5s3Oq5EC8BmcfKcd7IhUbTH_EYz8,1014
17
17
  bfabric_web_apps/utils/resource_utilities.py,sha256=N4EiUkxXHZ18jnU2OuRqaGSroCZ73Ogb9lkeA21Kvq4,5716
18
- bfabric_web_apps/utils/run_main_pipeline.py,sha256=whmUbO9mMom9voOCv7iS51wh6St4DfawCD337BuPvtY,23112
19
- bfabric_web_apps-0.2.0.dist-info/LICENSE,sha256=k0O_i2k13i9e35aO-j7FerJafAqzzu8x0kkBs0OWF3c,1065
20
- bfabric_web_apps-0.2.0.dist-info/METADATA,sha256=vhqne76HPRsHA9uFhTPgP7wudTKYJq74V7GEQYR9S1I,687
21
- bfabric_web_apps-0.2.0.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
22
- bfabric_web_apps-0.2.0.dist-info/RECORD,,
18
+ bfabric_web_apps/utils/run_main_pipeline.py,sha256=-5o2QZW27OIvPJ_BtJ3s5UXoONOUcgUeXH4RSTN8oZg,23219
19
+ bfabric_web_apps-0.2.1.dist-info/LICENSE,sha256=k0O_i2k13i9e35aO-j7FerJafAqzzu8x0kkBs0OWF3c,1065
20
+ bfabric_web_apps-0.2.1.dist-info/METADATA,sha256=abK_cUI5x_js8GFj0gAHqo7pw7G98YW-IygicddE78o,687
21
+ bfabric_web_apps-0.2.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
22
+ bfabric_web_apps-0.2.1.dist-info/RECORD,,