summaryrefslogtreecommitdiff
path: root/wasp/wasp.py
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2021-01-10 10:37:25 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2021-01-10 10:37:25 (GMT)
commita6eab3e7ffcd9f6530c54931bbba3e0f108e0dd3 (patch)
tree81b9816302fa403d8ffd4fbb5399a811612f7ef5 /wasp/wasp.py
parented242b84a6e70aff344669559c038348c822413a (diff)
system: Allows apps to be registered using strings
Use instance tests to identify strings and substitute then for an instanciated class. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/wasp.py')
-rw-r--r--wasp/wasp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/wasp/wasp.py b/wasp/wasp.py
index 79f706c..c9f40db 100644
--- a/wasp/wasp.py
+++ b/wasp/wasp.py
@@ -164,6 +164,10 @@ class Manager():
:param object app: The application to regsister
"""
+ if isinstance(app, str):
+ exec('import ' + app[:app.rindex('.')])
+ app = eval(app + '()')
+
if quick_ring == True:
self.quick_ring.append(app)
else: