mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-10 01:30:56 +08:00
Rename argument "filter" to "subpath"
This commit is contained in:
@@ -60,8 +60,8 @@ def render_item_tree(item_tree, item_source):
|
|||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
def render_item_source(item_source, filter=None):
|
def render_item_source(item_source, path=None):
|
||||||
item_tree = item_source.list_items(filter)
|
item_tree = item_source.list_items(path)
|
||||||
filterpart = "" if filter is None else ":" + filter
|
path_part = "" if path is None else ":" + path
|
||||||
heading = f"<h6><a href='/filecrawl.html?source={urllib.parse.quote_plus(item_source.name)}'>{item_source.name}</a>{filterpart}</h6>"
|
heading = f"<h6><a href='/filecrawl.html?source={urllib.parse.quote_plus(item_source.name)}'>{item_source.name}</a>{path_part}</h6>"
|
||||||
return heading + render_item_tree(item_tree, item_source)
|
return heading + render_item_tree(item_tree, item_source)
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ class FileItemSource(ItemSource):
|
|||||||
def get_annotations_subpath(self, item) -> str:
|
def get_annotations_subpath(self, item) -> str:
|
||||||
return self.convert_h5ad_path_to_annotation(item.descriptor)
|
return self.convert_h5ad_path_to_annotation(item.descriptor)
|
||||||
|
|
||||||
def list_items(self, filter: str = None) -> ItemTree:
|
def list_items(self, subpath: str = None) -> ItemTree:
|
||||||
item_tree = self.scan_directory("" if filter is None else filter)
|
item_tree = self.scan_directory("" if subpath is None else subpath)
|
||||||
|
|
||||||
"""def get_items(dir):
|
"""def get_items(dir):
|
||||||
if dir.branches:
|
if dir.branches:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class LookupResult:
|
|||||||
|
|
||||||
class ItemSource(ABC):
|
class ItemSource(ABC):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def list_items(self, filter: str = None) -> List[Item]:
|
def list_items(self, subpath: str = None) -> List[Item]:
|
||||||
raise Exception('"list_items" unimplemented')
|
raise Exception('"list_items" unimplemented')
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ class S3ItemSource(ItemSource):
|
|||||||
def get_annotations_subpath(self, item) -> str:
|
def get_annotations_subpath(self, item) -> str:
|
||||||
return self.convert_h5ad_key_to_annotation(item.descriptor)
|
return self.convert_h5ad_key_to_annotation(item.descriptor)
|
||||||
|
|
||||||
def list_items(self, filter: str = None) -> ItemTree:
|
def list_items(self, subpath: str = None) -> ItemTree:
|
||||||
item_tree = self.scan_directory("" if filter is None else filter)
|
item_tree = self.scan_directory("" if subpath is None else subpath)
|
||||||
return item_tree
|
return item_tree
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user