Skip to content

Commit

Permalink
Gets file name from marc path stem
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreben committed May 1, 2024
1 parent ee78f53 commit 6ea710f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libsys_airflow/plugins/data_exports/marc/gobi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

def gobi_list_from_marc_files(marc_file_list: str, full_dump: bool):
gobi_transformer = GobiTransformer()
gobi_list = datetime.now().strftime("%Y%m%d")
for marc_file in ast.literal_eval(marc_file_list):
gobi_transformer.generate_list(marc_file=marc_file, gobi_list=gobi_list)
gobi_transformer.generate_list(marc_file=marc_file)


class GobiTransformer(Transformer):
def generate_list(self, marc_file, gobi_list):
def generate_list(self, marc_file, gobi_list_name):
marc_path = pathlib.Path(marc_file)
gobi_path = pathlib.Path(marc_path.parent.parent) / f"stf.{gobi_list}.txt"
gobi_list_name = marc_path.stem
gobi_path = pathlib.Path(marc_path.parent.parent) / f"stf.{gobi_list_name}.txt"

with marc_path.open('rb') as fo:
marc_records = [record for record in pymarc.MARCReader(fo)]
Expand Down

0 comments on commit 6ea710f

Please sign in to comment.