From 86fc63c4ca9d36eae7512c5c3e640285d84415d1 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Wed, 23 Feb 2022 14:59:51 -0500 Subject: 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. --- release/scripts/startup/bl_operators/wm.py | 20 +++++++++----------- release/scripts/startup/bl_ui/space_topbar.py | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'release/scripts/startup') diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index fd0671a2369..a7f401afad1 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -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) diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index e6d2d1403b5..e488e23c777 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -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( -- cgit v1.2.3