Browse Source

[MNT] modify get_learnware_path_by_ids to get_learnware_zip_path_by_ids

tags/v0.3.2
Gene 2 years ago
parent
commit
00a10f0ebf
3 changed files with 7 additions and 7 deletions
  1. +5
    -5
      learnware/market/base.py
  2. +1
    -1
      learnware/market/easy.py
  3. +1
    -1
      learnware/market/easy2/organizer.py

+ 5
- 5
learnware/market/base.py View File

@@ -172,7 +172,7 @@ class LearnwareMarket:
int int
The final learnware check_status. The final learnware check_status.
""" """
zip_path = self.get_learnware_path_by_ids(id) if zip_path is None else zip_path
zip_path = self.get_learnware_zip_path_by_ids(id) if zip_path is None else zip_path
semantic_spec = ( semantic_spec = (
self.get_learnware_by_ids(id).get_specification().get_semantic_spec() self.get_learnware_by_ids(id).get_specification().get_semantic_spec()
if semantic_spec is None if semantic_spec is None
@@ -223,8 +223,8 @@ class LearnwareMarket:
""" """
return self.learnware_organizer.get_learnwares(top, check_status, **kwargs) return self.learnware_organizer.get_learnwares(top, check_status, **kwargs)


def get_learnware_path_by_ids(self, ids: Union[str, List[str]], **kwargs) -> Union[Learnware, List[Learnware]]:
return self.learnware_organizer.get_learnware_path_by_ids(ids, **kwargs)
def get_learnware_zip_path_by_ids(self, ids: Union[str, List[str]], **kwargs) -> Union[Learnware, List[Learnware]]:
return self.learnware_organizer.get_learnware_zip_path_by_ids(ids, **kwargs)


def get_learnware_by_ids(self, id: Union[str, List[str]], **kwargs) -> Union[Learnware, List[Learnware]]: def get_learnware_by_ids(self, id: Union[str, List[str]], **kwargs) -> Union[Learnware, List[Learnware]]:
return self.learnware_organizer.get_learnware_by_ids(id, **kwargs) return self.learnware_organizer.get_learnware_by_ids(id, **kwargs)
@@ -331,7 +331,7 @@ class BaseOrganizer:
""" """
raise NotImplementedError("get_learnware_by_ids is not implemented in BaseOrganizer") raise NotImplementedError("get_learnware_by_ids is not implemented in BaseOrganizer")


def get_learnware_path_by_ids(self, ids: Union[str, List[str]]) -> Union[Learnware, List[Learnware]]:
def get_learnware_zip_path_by_ids(self, ids: Union[str, List[str]]) -> Union[Learnware, List[Learnware]]:
"""Get Zipped Learnware file by id """Get Zipped Learnware file by id


Parameters Parameters
@@ -347,7 +347,7 @@ class BaseOrganizer:
Return the path for target learnware or list of path. Return the path for target learnware or list of path.
None for Learnware NOT Found. None for Learnware NOT Found.
""" """
raise NotImplementedError("get_learnware_path_by_ids is not implemented in BaseOrganizer")
raise NotImplementedError("get_learnware_zip_path_by_ids is not implemented in BaseOrganizer")


def get_learnware_ids(self, top: int = None, check_status: int = None) -> List[str]: def get_learnware_ids(self, top: int = None, check_status: int = None) -> List[str]:
"""get the list of learnware ids """get the list of learnware ids


+ 1
- 1
learnware/market/easy.py View File

@@ -926,7 +926,7 @@ class EasyMarket(LearnwareMarket):
logger.warning("Learnware ID '%s' NOT Found!" % (ids)) logger.warning("Learnware ID '%s' NOT Found!" % (ids))
return None return None


def get_learnware_path_by_ids(self, ids: Union[str, List[str]]) -> Union[Learnware, List[Learnware]]:
def get_learnware_zip_path_by_ids(self, ids: Union[str, List[str]]) -> Union[Learnware, List[Learnware]]:
"""Get Zipped Learnware file by id """Get Zipped Learnware file by id


Parameters Parameters


+ 1
- 1
learnware/market/easy2/organizer.py View File

@@ -256,7 +256,7 @@ class EasyOrganizer(BaseOrganizer):
logger.warning("Learnware ID '%s' NOT Found!" % (ids)) logger.warning("Learnware ID '%s' NOT Found!" % (ids))
return None return None


def get_learnware_path_by_ids(self, ids: Union[str, List[str]]) -> Union[Learnware, List[Learnware]]:
def get_learnware_zip_path_by_ids(self, ids: Union[str, List[str]]) -> Union[Learnware, List[Learnware]]:
"""Get Zipped Learnware file by id """Get Zipped Learnware file by id


Parameters Parameters


Loading…
Cancel
Save