Adding barcode magic commands:
[htsworkflow.git] / samplebc / bcmagic / plugin.py
diff --git a/samplebc/bcmagic/plugin.py b/samplebc/bcmagic/plugin.py
new file mode 100644 (file)
index 0000000..759b1fd
--- /dev/null
@@ -0,0 +1,18 @@
+from samplebc.samples import bcm_cmds
+
+BCM_PLUGINS = {'cmd_move_sample': bcm_cmds.cmd_move_sample}
+
+
+def bcm_plugin_processor(keyword, text, bcm_mode):
+    """
+    Fixme should be made generic plugable, but am hard coding values for proof
+    of concept.
+    """
+    d = {}
+    
+    if bcm_mode not in BCM_PLUGINS:
+        d['mode'] = 'Error'
+        d['status'] = 'bcm_mode plugin called "%s" was not found' % (bcm_mode)
+        return d
+    
+    return BCM_PLUGINS[bcm_mode](keyword, text, bcm_mode)
\ No newline at end of file