Adding barcode magic commands:
[htsworkflow.git] / samplebc / bcmagic / utils.py
diff --git a/samplebc/bcmagic/utils.py b/samplebc/bcmagic/utils.py
new file mode 100644 (file)
index 0000000..5ee81a9
--- /dev/null
@@ -0,0 +1,22 @@
+
+
+def report_error(message):
+    """
+    Return a dictionary with a command to display 'message'
+    """
+    return {'mode': 'Error', 'status': message}
+    
+
+def redirect_to_url(url):
+    """
+    Return a bcm dictionary with a command to redirect to 'url'
+    """
+    return {'mode': 'redirect', 'url': url}
+    
+
+def autofill(field, value):
+    """
+    Return a bcm dictionary with a command to automatically fill the
+    corresponding "field" with "value"
+    """
+    return {'mode': 'autofill', 'field': field, 'value': value}
\ No newline at end of file