added sign key

This commit is contained in:
Matthias 2021-09-24 00:11:19 +02:00
parent 24421ee814
commit 62702069a0
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -159,17 +159,25 @@ def get_git_log(path):
class GitStatus: class GitStatus:
class definition: class definition:
key: str = 'N' key: str = 'N'
status: int = 0 status: int = 2
msg_sign: str = '' msg_sign: str = ''
msg_key: str = '' msg_key: str = ''
def __init__(self, key: str='N', status: int = 0, msg_sign: str = '', msg_key: str = '') -> None: def __init__(self, key: str='N', status: int = 2, msg_sign: str = '', msg_key: str = '') -> None:
self.key = key self.key = key
self.status = status self.status = status
self.msg_sign = msg_sign self.msg_sign = msg_sign
self.msg_key = msg_key self.msg_key = msg_key
E = definition(key='N', status=1, msg_sign='no signature',) N = definition(key='N', status=2, msg_sign='no signature',)
G = definition(key='G', status=0, msg_sign='valid signature',)
B = definition(key='B', status=2, msg_sign='bad signature',)
U = definition(key='U', status=1, msg_sign='good signature, unknown validity',)
X = definition(key='X', status=1, msg_sign='good signature, expired',)
Y = definition(key='Y', status=1, msg_sign='good signature, expired key',)
R = definition(key='R', status=2, msg_sign='good signature, revoked key',)
E = definition(key='E', status=1, msg_sign='cannot be checked',)
class IntegrationPlugin(MixinBase, plugin.InvenTreePlugin): class IntegrationPlugin(MixinBase, plugin.InvenTreePlugin):
""" """
@ -198,7 +206,7 @@ class IntegrationPlugin(MixinBase, plugin.InvenTreePlugin):
# fetch git log # fetch git log
commit = self.get_plugin_commit() commit = self.get_plugin_commit()
# resolve state # resolve state
sign_state = getattr(GitStatus, commit['verified'], GitStatus.E) sign_state = getattr(GitStatus, commit['verified'], GitStatus.N)
# set variables # set variables
self.commit = commit self.commit = commit