mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-19 04:09:40 +08:00
Added a comment(explanation) to an unused code of the Toolbox.
This commit is contained in:
parent
70a95e68d6
commit
2b11152c4d
@ -67,17 +67,22 @@ class PackagesModel(ListModel):
|
|||||||
|
|
||||||
links_dict = {}
|
links_dict = {}
|
||||||
if "data" in package:
|
if "data" in package:
|
||||||
|
# Links is a list of dictionaries with "title" and "url". Convert this list into a dict so it's easier
|
||||||
|
# to process.
|
||||||
|
link_list = package["data"]["links"] if "links" in package["data"] else []
|
||||||
|
links_dict = {d["title"]: d["url"] for d in link_list}
|
||||||
|
|
||||||
|
# This code never gets executed because the API response does not contain "supported_configs" in it
|
||||||
|
# It is so because 2y ago when this was created - it did contain it. But it was a prototype only
|
||||||
|
# and never got to production. As agreed with the team, it'll stay here for now, in case we decide to rework and use it
|
||||||
|
# The response payload has been changed. Please see:
|
||||||
|
# https://github.com/Ultimaker/Cura/compare/CURA-7072-temp?expand=1
|
||||||
if "supported_configs" in package["data"]:
|
if "supported_configs" in package["data"]:
|
||||||
if len(package["data"]["supported_configs"]) > 0:
|
if len(package["data"]["supported_configs"]) > 0:
|
||||||
has_configs = True
|
has_configs = True
|
||||||
configs_model = ConfigsModel()
|
configs_model = ConfigsModel()
|
||||||
configs_model.setConfigs(package["data"]["supported_configs"])
|
configs_model.setConfigs(package["data"]["supported_configs"])
|
||||||
|
|
||||||
# Links is a list of dictionaries with "title" and "url". Convert this list into a dict so it's easier
|
|
||||||
# to process.
|
|
||||||
link_list = package["data"]["links"] if "links" in package["data"] else []
|
|
||||||
links_dict = {d["title"]: d["url"] for d in link_list}
|
|
||||||
|
|
||||||
if "author_id" not in package["author"] or "display_name" not in package["author"]:
|
if "author_id" not in package["author"] or "display_name" not in package["author"]:
|
||||||
package["author"]["author_id"] = ""
|
package["author"]["author_id"] = ""
|
||||||
package["author"]["display_name"] = ""
|
package["author"]["display_name"] = ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user