Skip to content

Commit

Permalink
Add function to get bl_info for future use
Browse files Browse the repository at this point in the history
It's taken from the closed pull request b-init#19.
  • Loading branch information
thanhph111 committed Aug 30, 2021
1 parent 7201023 commit c136dc0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions imagepaste/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,14 @@ def get_addon_preferences() -> bpy.types.AddonPreferences:
bpy.types.AddonPreferences: The addon preferences.
"""
return bpy.context.preferences.addons[ADDON_NAME].preferences


def get_addon_bl_info() -> dict:
"""Get add-on bl_info defined in __init__.py.
Returns:
dict: a dictionary containing add-on info.
"""
from importlib import import_module

return import_module(ADDON_NAME).bl_info

0 comments on commit c136dc0

Please sign in to comment.