Skip to content

Commit

Permalink
collection_manager: Merge get_resource_status and get_collection
Browse files Browse the repository at this point in the history
`get_resource_status` was only introduced while `get_html` was still
present with `get_collection`.
  • Loading branch information
ptitjano committed Mar 6, 2024
1 parent bb1cc6d commit e4e48a3
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions qgis_resource_sharing/collection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ def get_collection_id(self, register_name, repo_url):
hex_dig = hash_object.hexdigest()
return hex_dig

def get_resource_status(self, collection_id: str) -> str:
"""Return the status (installed, not installed) of a collection
as HTML, given its id.
def get_collection(self, collection_id: str) -> Dict[str, str]:
"""Return the details of a collection, given its id.
:param collection_id: The id of the collection
:type collection_id: str
Expand All @@ -109,16 +108,7 @@ def get_resource_status(self, collection_id: str) -> str:
if config.COLLECTIONS[collection_id]["status"] != COLLECTION_INSTALLED_STATUS:
html = "<i>Unknown before installation</i>"

return html

def get_collection(self, collection_id: str) -> Dict[str, str]:
"""Return the details of a collection, given its id.
:param collection_id: The id of the collection
:type collection_id: str
"""
resource_html = self.get_resource_status(collection_id)
config.COLLECTIONS[collection_id]["resources_html"] = resource_html
config.COLLECTIONS[collection_id]["resources_html"] = html
return config.COLLECTIONS[collection_id]

def get_installed_collections(self, repo_url=None):
Expand Down

0 comments on commit e4e48a3

Please sign in to comment.