diff write_db_summary.py @ 0:35bcefc9176b draft default tip

planemo upload for repository https://github.com/sanbi-sa/tools-sanbi-uwc commit dbd9af1e941e35ec9ca2a9f75af02edea67a5981
author sanbi-uwc
date Thu, 15 Jun 2017 07:41:38 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/write_db_summary.py	Thu Jun 15 07:41:38 2017 -0400
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+from __future__ import print_function
+
+import argparse
+import os
+import os.path
+
+parser = argparse.ArgumentParser(
+    description="Write HTML summary from neostore datatype")
+parser.add_argument('basepath')
+parser.add_argument('label')
+
+args = parser.parse_args()
+
+output = """<html><head><title>Files for Composite Dataset ({})</title></head>
+    <p/>This composite dataset is composed of
+     the following files:<p/><ul>\n""".format(args.label)
+db_path = args.basepath + '/neo4jdb/databases/graph.db'
+for filename in os.listdir(db_path):
+    if filename.startswith('.'):
+        continue
+    path = db_path + '/' + filename
+    if os.path.isdir(path):
+        continue
+    output += "<li>{}</li>\n".format(filename)
+output += '</ul></html>\b'
+print(output)