Addons: deprecate 'wiki_url'
When running with debug enabled ('-d' argument), warnings are printed for add-ons which are not yet updated. Reminder to name things based on what they do, not the technologies they use :)
This commit is contained in:

committed by
Campbell Barton

parent
3da2dc8213
commit
ae223ff52b
@@ -6,7 +6,7 @@ bl_info = {
|
|||||||
"location": "SpaceBar Search -> Add-on Preferences Example",
|
"location": "SpaceBar Search -> Add-on Preferences Example",
|
||||||
"description": "Example Add-on",
|
"description": "Example Add-on",
|
||||||
"warning": "",
|
"warning": "",
|
||||||
"wiki_url": "",
|
"doc_url": "",
|
||||||
"tracker_url": "",
|
"tracker_url": "",
|
||||||
"category": "Object",
|
"category": "Object",
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ bl_info = {
|
|||||||
"blender": (2, 80, 0),
|
"blender": (2, 80, 0),
|
||||||
"description": "Cycles renderer integration",
|
"description": "Cycles renderer integration",
|
||||||
"warning": "",
|
"warning": "",
|
||||||
"wiki_url": "https://docs.blender.org/manual/en/latest/render/cycles/",
|
"doc_url": "https://docs.blender.org/manual/en/latest/render/cycles/",
|
||||||
"tracker_url": "",
|
"tracker_url": "",
|
||||||
"support": 'OFFICIAL',
|
"support": 'OFFICIAL',
|
||||||
"category": "Render"}
|
"category": "Render"}
|
||||||
|
@@ -505,7 +505,7 @@ def module_bl_info(mod, info_basis=None):
|
|||||||
"blender": (),
|
"blender": (),
|
||||||
"location": "",
|
"location": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"wiki_url": "",
|
"doc_url": "",
|
||||||
"support": 'COMMUNITY',
|
"support": 'COMMUNITY',
|
||||||
"category": "",
|
"category": "",
|
||||||
"warning": "",
|
"warning": "",
|
||||||
@@ -527,5 +527,21 @@ def module_bl_info(mod, info_basis=None):
|
|||||||
if not addon_info["name"]:
|
if not addon_info["name"]:
|
||||||
addon_info["name"] = mod.__name__
|
addon_info["name"] = mod.__name__
|
||||||
|
|
||||||
|
# Replace 'wiki_url' with 'doc_url'.
|
||||||
|
doc_url = addon_info.pop("wiki_url", None)
|
||||||
|
if doc_url is not None:
|
||||||
|
# Unlikely, but possible that both are set.
|
||||||
|
if not addon_info["doc_url"]:
|
||||||
|
addon_info["doc_url"] = doc_url
|
||||||
|
if _bpy.app.debug:
|
||||||
|
print(
|
||||||
|
"Warning: add-on \"{addon_name}\": 'wiki_url' in 'bl_info' "
|
||||||
|
"is deprecated please use 'doc_url' instead!\n"
|
||||||
|
" {addon_path}".format(
|
||||||
|
addon_name=addon_info['name'],
|
||||||
|
addon_path=getattr(mod, "__file__", None),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
addon_info["_init"] = None
|
addon_info["_init"] = None
|
||||||
return addon_info
|
return addon_info
|
||||||
|
@@ -1873,16 +1873,16 @@ class USERPREF_PT_addons(AddOnPanel, Panel):
|
|||||||
split.label(text=" " + info["warning"], icon='ERROR')
|
split.label(text=" " + info["warning"], icon='ERROR')
|
||||||
|
|
||||||
user_addon = USERPREF_PT_addons.is_user_addon(mod, user_addon_paths)
|
user_addon = USERPREF_PT_addons.is_user_addon(mod, user_addon_paths)
|
||||||
tot_row = bool(info["wiki_url"]) + bool(user_addon)
|
tot_row = bool(info["doc_url"]) + bool(user_addon)
|
||||||
|
|
||||||
if tot_row:
|
if tot_row:
|
||||||
split = colsub.row().split(factor=0.15)
|
split = colsub.row().split(factor=0.15)
|
||||||
split.label(text="Internet:")
|
split.label(text="Internet:")
|
||||||
sub = split.row()
|
sub = split.row()
|
||||||
if info["wiki_url"]:
|
if info["doc_url"]:
|
||||||
sub.operator(
|
sub.operator(
|
||||||
"wm.url_open", text="Documentation", icon='HELP',
|
"wm.url_open", text="Documentation", icon='HELP',
|
||||||
).url = info["wiki_url"]
|
).url = info["doc_url"]
|
||||||
# Only add "Report a Bug" button if tracker_url is set
|
# Only add "Report a Bug" button if tracker_url is set
|
||||||
# or the add-on is bundled (use official tracker then).
|
# or the add-on is bundled (use official tracker then).
|
||||||
if info.get("tracker_url"):
|
if info.get("tracker_url"):
|
||||||
|
@@ -6,7 +6,7 @@ bl_info = {
|
|||||||
"location": "View3D > Add > Mesh > New Object",
|
"location": "View3D > Add > Mesh > New Object",
|
||||||
"description": "Adds a new Mesh Object",
|
"description": "Adds a new Mesh Object",
|
||||||
"warning": "",
|
"warning": "",
|
||||||
"wiki_url": "",
|
"doc_url": "",
|
||||||
"category": "Add Mesh",
|
"category": "Add Mesh",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user