Unverified Commit ada66fb5 authored by Duggan, John's avatar Duggan, John Committed by GitHub
Browse files

Merge pull request #108 from...

Merge pull request #108 from nova-model/103-dataselector---show-files-at-the-root-of-the-experimentcustom-directory

Show files at the root of the selected experiment/directory
parents 32cd12f6 408052a4
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
### nova-trame, 0.20.5

* DataSelector should now properly display files at the root of the selected directory (thanks to John Duggan).

### nova-trame, 0.20.4

* The Tornado dependency is now pinned to >=6.5 to address a DoS vulnerability (thanks to John Duggan).
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ Changelog = "https://code.ornl.gov/ndip/public-packages/nova-trame/blob/main/CHA

[tool.poetry]
name = "nova-trame"
version = "0.20.4"
version = "0.20.5"
description = "A Python Package for injecting curated themes and custom components into Trame applications"
authors = ["Duggan, John <dugganjw@ornl.gov>"]
readme = "README.md"
+9 −8
Original line number Diff line number Diff line
@@ -212,17 +212,18 @@ class DataSelectorModel:
    def get_datafiles(self) -> List[str]:
        datafiles = []

        if self.state.experiment:
            base_path = Path("/") / self.state.facility / self.get_instrument_dir() / self.state.experiment
        elif self.state.custom_directory:
            base_path = Path(self.state.custom_directory)
        else:
            return []

        try:
            if self.state.prefix:
                datafile_path = str(
                    Path("/")
                    / self.state.facility
                    / self.get_instrument_dir()
                    / self.state.experiment
                    / self.state.prefix
                )
                datafile_path = str(base_path / self.state.prefix)
            else:
                datafile_path = self.state.directory
                datafile_path = str(base_path / self.state.directory)

            for entry in os.scandir(datafile_path):
                if entry.is_file():