Deduplication of backend list

Fixes issue #609. Added backend list debug output (class name).
This commit is contained in:
Thomas Patzke
2020-02-03 22:16:00 +01:00
parent 666542ae7f
commit 1bc2c0b930
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ from sigma.tools import getAllSubclasses, getClassDict
def getBackendList():
"""Return list of backend classes"""
path = os.path.dirname(__file__)
return getAllSubclasses(path, "backends", BaseBackend)
return frozenset(getAllSubclasses(path, "backends", BaseBackend))
def getBackendDict():
return getClassDict(getBackendList())
+4 -1
View File
@@ -126,7 +126,10 @@ if cmdargs.debug: # pragma: no cover
def list_backends():
for backend in backends.getBackendList():
print("{:>15} : {}".format(backend.identifier, backend.__doc__))
if cmdargs.debug:
print("{:>15} : {} ({})".format(backend.identifier, backend.__doc__, backend.__name__))
else:
print("{:>15} : {}".format(backend.identifier, backend.__doc__))
def list_configurations(backend=None):
for conf_id, title, backends in scm.list():