Skip to content

Commit

Permalink
Method to init separator for filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrake-merani committed Dec 13, 2024
1 parent d872801 commit bf4962b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sasdata/ascii_reader_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class AsciiReaderMetadata:
filename_separator: dict[str, str | bool] = field(default_factory=dict)
master_metadata: dict[str, AsciiMetadataCategory[int]] = field(default_factory=default_categories)

def init_separator(self, filename: str):
separator = next(filter(lambda c: c in SEPARATOR_PRECEDENCE, filename), True)
self.filename_separator[filename] = separator

def filename_components(self, filename: str, cut_off_extension: bool = True, capture: bool = False) -> list[str]:
separator = self.filename_separator[filename]
# FIXME: This sort of string construction may be an issue. Might need an alternative.
Expand Down

0 comments on commit bf4962b

Please sign in to comment.