Skip to content

Commit

Permalink
Merge pull request #27 from paulsaxe/main
Browse files Browse the repository at this point in the history
Changes needed to support Paths as well as strings for the files.
  • Loading branch information
seamm authored Jan 29, 2022
2 parents 1a4898e + d94077c commit 5a7880c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions read_structure_step/read_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

import logging
from pathlib import PurePath
from pathlib import PurePath, Path

from .formats.registries import get_format_metadata
import read_structure_step
Expand Down Expand Up @@ -84,7 +84,10 @@ def description_text(self, P=None):

# What type of file?
extension = ""
filename = P["file"].strip()
if isinstance(P["file"], Path):
filename = str(P["file"])
else:
filename = P["file"].strip()
file_type = P["file type"]

if self.is_expr(filename) or self.is_expr(file_type):
Expand Down Expand Up @@ -119,7 +122,10 @@ def run(self):
)

# What type of file?
filename = P["file"].strip()
if isinstance(P["file"], Path):
filename = str(P["file"])
else:
filename = ["file"].strip()
file_type = P["file type"]

if file_type != "from extension":
Expand Down

0 comments on commit 5a7880c

Please sign in to comment.