Cleanup: remove function for accessing supported add-ons

This was only called once in a situation where such functions
are typically used as a dynamic enum callbacks.

Prefer keeping the items close to the EnumProperty definition &
avoid the need to note why this is a special case that doesn't follow
the common pattern for enum callbacks.
This commit is contained in:
Campbell Barton 2022-12-15 09:39:23 +11:00
parent e476afff41
commit 2dd27d5f06
1 changed files with 11 additions and 13 deletions

View File

@ -95,18 +95,6 @@ _modules_loaded = [_namespace[name] for name in _modules]
del _namespace
def _addon_support_items():
"""Return the addon support levels suitable for this Blender build."""
items = [
('OFFICIAL', "Official", "Officially supported"),
('COMMUNITY', "Community", "Maintained by community developers"),
]
if bpy.app.version_cycle == 'alpha':
items.append(('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"))
return items
def register():
from bpy.utils import register_class
for mod in _modules_loaded:
@ -152,13 +140,23 @@ def register():
description="Filter add-ons by category",
)
# These items are static but depend on the version cycle.
items = [
('OFFICIAL', "Official", "Officially supported"),
('COMMUNITY', "Community", "Maintained by community developers"),
]
if bpy.app.version_cycle == "alpha":
items.append(('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"))
WindowManager.addon_support = EnumProperty(
items=_addon_support_items(),
items=items,
name="Support",
description="Display support level",
default={'OFFICIAL', 'COMMUNITY'},
options={'ENUM_FLAG'},
)
del items
# done...