Cleanup: Simplify manual url version handling

Recently we changed the build pipeline to always create a version
number in the url and point 'dev' to the latest version rather than creating the version number url once we release.

This makes the check to `bpy.app.version_cycle` unnecessary.
This commit is contained in:
Aaron Carlisle 2022-02-23 14:59:51 -05:00
parent 6ca85a8cf1
commit 86fc63c4ca
Notes: blender-bot 2023-02-14 08:58:01 +01:00
Referenced by commit fc8aab755a, Fix T96015: Calling wrong operator resulting in python error
Referenced by issue #96015, Report Bug button is Bugged (Python version bump issue)
4 changed files with 12 additions and 22 deletions

View File

@ -489,12 +489,7 @@ def disable_all():
def _blender_manual_url_prefix():
if _bpy.app.version_cycle in {"rc", "release"}:
manual_version = "%d.%d" % _bpy.app.version[:2]
else:
manual_version = "dev"
return "https://docs.blender.org/manual/en/" + manual_version
return "https://docs.blender.org/manual/en/%d.%d" % _bpy.app.version[:2]
def module_bl_info(mod, *, info_basis=None):

View File

@ -3,10 +3,7 @@
import bpy
if bpy.app.version_cycle in {'rc', 'release'}:
manual_version = '%d.%d' % bpy.app.version[:2]
else:
manual_version = 'dev'
manual_version = '%d.%d' % bpy.app.version[:2]
url_manual_prefix = "https://docs.blender.org/manual/en/" + manual_version + "/"

View File

@ -995,11 +995,10 @@ class WM_OT_url_open_preset(Operator):
return "https://www.blender.org/download/releases/%d-%d/" % bpy.app.version[:2]
def _url_from_manual(self, _context):
if bpy.app.version_cycle in {"rc", "release"}:
manual_version = "%d.%d" % bpy.app.version[:2]
else:
manual_version = "dev"
return "https://docs.blender.org/manual/en/" + manual_version + "/"
return "https://docs.blender.org/manual/en/%d.%d/" % bpy.app.version[:2]
def _url_from_api(self, _context):
return "https://docs.blender.org/api/%d.%d/" % bpy.app.version[:2]
# This list is: (enum_item, url) pairs.
# Allow dynamically extending.
@ -1014,9 +1013,12 @@ class WM_OT_url_open_preset(Operator):
(('RELEASE_NOTES', "Release Notes",
"Read about what's new in this version of Blender"),
_url_from_release_notes),
(('MANUAL', "Manual",
(('MANUAL', "User Manual",
"The reference manual for this version of Blender"),
_url_from_manual),
(('API', "Python API Reference",
"The API reference manual for this version of Blender"),
_url_from_api),
# Static URL's.
(('FUND', "Development Fund",
@ -1231,11 +1233,7 @@ class WM_OT_doc_view(Operator):
bl_label = "View Documentation"
doc_id: doc_id
if bpy.app.version_cycle in {"release", "rc", "beta"}:
_prefix = ("https://docs.blender.org/api/%d.%d" %
(bpy.app.version[0], bpy.app.version[1]))
else:
_prefix = ("https://docs.blender.org/api/master")
_prefix = "https://docs.blender.org/api/%d.%d" % bpy.app.version[:2]
def execute(self, _context):
url = _wm_doc_get_id(self.doc_id, do_url=True, url_prefix=self._prefix, report=self.report)

View File

@ -689,7 +689,7 @@ class TOPBAR_MT_help(Menu):
layout.operator(
"wm.url_open", text="Python API Reference", icon='URL',
).url = bpy.types.WM_OT_doc_view._prefix
).type = 'API'
if show_developer:
layout.operator(