Skip to content

Commit

Permalink
Using glob to read xml files
Browse files Browse the repository at this point in the history
  • Loading branch information
sugan89 committed Aug 5, 2024
1 parent de885dc commit 65d8f93
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pe2loaddata/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import csv
import os
import glob
import shutil
import tempfile
import xml.sax
Expand Down Expand Up @@ -72,10 +73,7 @@ def headless(
if not index_file:
index_file = os.path.join(index_directory, "Index.xml")

if "s3" not in index_file:
if not os.path.exists(index_file):
index_file = os.path.join(index_directory, "Index.idx.xml")


if "s3" in index_file:
remote = True
if not index_directory:
Expand Down Expand Up @@ -104,6 +102,9 @@ def headless(
print('Index.idx.xml not found') #have to add better print statements
print(f"Looking for index_file at {index_file_key}")
return

if "s3" not in index_file:
index_file = glob.glob(f"{index_directory}" + "/*.xml")

handler = content.Handler()

Expand Down

0 comments on commit 65d8f93

Please sign in to comment.