2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 12:36:45 +00:00

prepare fnc for loading metadata

This commit is contained in:
Matthias 2021-11-04 13:07:35 +01:00
parent dd61714435
commit 285e6fe93e
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -345,16 +345,20 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
return getattr(self, fnc_name, True) return getattr(self, fnc_name, True)
return False return False
# git # package info
def get_package_commit(self): def get_package_commit(self):
"""get last git commit for plugin""" """get last git commit for plugin"""
return get_git_log(self.def_path) return get_git_log(self.def_path)
def get_package_metadata(self):
"""get package metadata for plugin"""
return {}
def set_package(self): def set_package(self):
"""add packaging info of the plugins into plugins context""" """add packaging info of the plugins into plugins context"""
if self.is_package: if self.is_package:
# is a package - no commit # is a package - no commit
package = {} package = self.get_package_metadata()
else: else:
# fetch git commit # fetch git commit
package = self.get_package_commit() package = self.get_package_commit()