Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore folders feature #55

Open
wants to merge 15 commits into
base: seamlisten
Choose a base branch
from

Conversation

david-wagih
Copy link

Why ?

We need to have this feature in order to be able to explore all folders and sub folders we need to scan to look for audio files on our seamlisten tool easily (like a JupyterNotebook)

How ?

I have build a method to gather the folder contents given the parent folder path using os.walk() method to do that effectively, and return all the folder contents in an array well constructed.
and this endpoint is called whenver the path the user enters is a path to a directory not a normal file.

Test plan

when running the frontend and the backend successfully, paste in the field to fetch a path to a folder and when pressing fetch, if you opened the console you should see an array of folder contents shown correctly.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2023
@david-wagih
Copy link
Author

@Mortimerp9 @Celebio

@david-wagih david-wagih requested a review from Mortimerp9 August 24, 2023 06:25
Copy link
Contributor

@Mortimerp9 Mortimerp9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some changes on the python code

stopes/ui/seamlisten/backend/app/fileviewer.py Outdated Show resolved Hide resolved
stopes/ui/seamlisten/backend/app/fileviewer.py Outdated Show resolved Hide resolved
stopes/ui/seamlisten/backend/app/fileviewer.py Outdated Show resolved Hide resolved
stopes/ui/seamlisten/backend/app/fileviewer.py Outdated Show resolved Hide resolved
stopes/ui/seamlisten/react_app/src/App.tsx Outdated Show resolved Hide resolved
@david-wagih david-wagih requested a review from Mortimerp9 August 29, 2023 16:55
stopes/ui/seamlisten/backend/app/fileviewer.py Outdated Show resolved Hide resolved
stopes/ui/seamlisten/backend/app/fileviewer.py Outdated Show resolved Hide resolved
stopes/ui/seamlisten/backend/app/fileviewer.py Outdated Show resolved Hide resolved
@david-wagih david-wagih changed the title Explore folders feature (backend side) Explore folders feature Sep 6, 2023
@david-wagih
Copy link
Author

image

this is a screenshot showing the Tree View in action.
@Mortimerp9

print(query_path.split(" "))
if query_path.endswith(".tsv.gz") or query_path.endswith(".zip"):
query_path_str = query.gz_path.strip()
query_path = Path(query_path_str).expanduser().resolve()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this work when the path is one of the other formats (which are not paths?), like:

a/b/c 100 10000
a/b/c|0|231231

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it will work normally

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mortimerp9
can you re-review this PR

david-wagih and others added 2 commits September 7, 2023 12:11
Co-authored-by: Pierre Andrews <628467+Mortimerp9@users.noreply.github.com>
Co-authored-by: Pierre Andrews <628467+Mortimerp9@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants