Skip to content

Commit

Permalink
Scan for netpyne resources
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Feb 6, 2024
1 parent 9f9afd8 commit d229122
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def update_workspace_resources(self, workspace_id, resources):
# not found --> create a new wsr
filename = os.path.basename(resource)
wsr = WorkspaceResourceEntity(
name=filename,
name=filename if not "index" in filename else os.path.basename(os.path.dirname(resource)),
folder=resource,
origin='{"path": "' + resource + '"}',
status=ResourceStatus.P, # default status
Expand Down
5 changes: 3 additions & 2 deletions applications/workspaces/tasks/scan-workspace/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
if ".ipynb_checkpoints" in root:
continue
for file in files:
full_file_name = os.path.join(root, file)

filename, file_extension = os.path.splitext(full_file_name)
if file_extension.lower() in (".nwb", ".netpyne", ".ipynb"):
if file_extension.lower() in (".nwb", ".npjson", ".ipynb"):
logger.info(f"Found resource: {full_file_name}")
full_file_name = os.path.join(root, file)
resources.append(full_file_name)

payload = {
Expand Down

0 comments on commit d229122

Please sign in to comment.