diff options
Diffstat (limited to 'release/scripts/startup/bl_operators/wm.py')
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 9ba5480cf5a..a7f401afad1 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -963,21 +963,19 @@ class WM_OT_url_open(Operator): return {'FINISHED'} -# NOTE: needed for Python 3.10 since there are name-space issues with annotations. -# This can be moved into the class as a static-method once Python 3.9x is dropped. -def _wm_url_open_preset_type_items(_self, _context): - return [item for (item, _) in WM_OT_url_open_preset.preset_items] - - class WM_OT_url_open_preset(Operator): """Open a preset website in the web browser""" bl_idname = "wm.url_open_preset" bl_label = "Open Preset Website" bl_options = {'INTERNAL'} + @staticmethod + def _wm_url_open_preset_type_items(_self, _context): + return [item for (item, _) in WM_OT_url_open_preset.preset_items] + type: EnumProperty( name="Site", - items=_wm_url_open_preset_type_items, + items=WM_OT_url_open_preset._wm_url_open_preset_type_items, ) id: StringProperty( @@ -997,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. @@ -1016,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", @@ -1233,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) @@ -1283,12 +1279,6 @@ rna_vector_subtype_items = ( ) -# NOTE: needed for Python 3.10 since there are name-space issues with annotations. -# This can be moved into the class as a static-method once Python 3.9x is dropped. -def _wm_properties_edit_subtype_items(_self, _context): - return WM_OT_properties_edit.subtype_items - - class WM_OT_properties_edit(Operator): """Change a custom property's type, or adjust how it is displayed in the interface""" bl_idname = "wm.properties_edit" @@ -1395,7 +1385,7 @@ class WM_OT_properties_edit(Operator): ) subtype: EnumProperty( name="Subtype", - items=_wm_properties_edit_subtype_items, + items=WM_OT_properties_edit.subtype_items, ) # String properties. |