Skip to content

Commit

Permalink
check the index_file
Browse files Browse the repository at this point in the history
  • Loading branch information
sugan89 committed Jul 25, 2024
1 parent 16fb3ed commit 5400749
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pe2loaddata/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ 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
Expand Down Expand Up @@ -102,11 +106,9 @@ def headless(
print(f"Looking for index_file at {index_file_key}")
return


handler = content.Handler()

if os.path.exists(index_file):
xml.sax.parse(index_file, handler)

xml.sax.parse(index_file, handler)

images = handler.root.images.images
plates = handler.root.plates.plates
Expand Down

0 comments on commit 5400749

Please sign in to comment.