folio-data-import 0.2.8rc5__tar.gz → 0.2.8rc6__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 folio-data-import might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: folio_data_import
3
- Version: 0.2.8rc5
3
+ Version: 0.2.8rc6
4
4
  Summary: A python module to interact with the data importing capabilities of the open-source FOLIO ILS
5
5
  License: MIT
6
6
  Author: Brooks Travis
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "folio_data_import"
3
- version = "0.2.8rc5"
3
+ version = "0.2.8rc6"
4
4
  description = "A python module to interact with the data importing capabilities of the open-source FOLIO ILS"
5
5
  authors = ["Brooks Travis <brooks.travis@gmail.com>"]
6
6
  license = "MIT"
@@ -505,14 +505,17 @@ class MARCImportJob:
505
505
  f"/metadata-provider/jobSummary/{self.job_id}"
506
506
  )
507
507
  self.current_retry_timeout = None
508
- except (httpx.ConnectTimeout, httpx.ReadTimeout):
509
- sleep(.25)
510
- with httpx.Client(
511
- timeout=self.current_retry_timeout,
512
- verify=self.folio_client.ssl_verify
513
- ) as temp_client:
514
- self.folio_client.httpx_client = temp_client
515
- return await self.get_job_summary()
508
+ except (httpx.ConnectTimeout, httpx.ReadTimeout, httpx.HTTPStatusError) as e:
509
+ if not hasattr(e, "response") or e.response.status_code == 502:
510
+ sleep(.25)
511
+ with httpx.Client(
512
+ timeout=self.current_retry_timeout,
513
+ verify=self.folio_client.ssl_verify
514
+ ) as temp_client:
515
+ self.folio_client.httpx_client = temp_client
516
+ return await self.get_job_status()
517
+ else:
518
+ raise e
516
519
  return job_summary
517
520
 
518
521
 
@@ -595,6 +598,8 @@ async def main() -> None:
595
598
  else:
596
599
  marc_files = list(Path("./").glob(args.marc_file_path))
597
600
 
601
+ marc_files.sort()
602
+
598
603
  if len(marc_files) == 0:
599
604
  print(f"No files found matching {args.marc_file_path}. Exiting.")
600
605
  sys.exit(1)
@@ -81,4 +81,4 @@ def sudoc_supercede_prep(record: pymarc.Record) -> pymarc.Record:
81
81
  ]
82
82
  )
83
83
  record.add_ordered_field(_935)
84
- return record
84
+ return record