do_import.py
branchxbelweb
changeset 26 17b0cd274530
child 43 4d194fce51e1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/do_import.py	Sat Sep 27 03:17:30 2003 -0400
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+import sys
+import traceback
+sys.path.insert(0, "/home/fabien/lib/python")
+sys.path.insert(0, "./lib")
+sys.stderr = sys.stdout
+
+print "Content-type: text/html; charset=iso-8859-1;"
+print
+
+# import cgitb; cgitb.enable()
+import cgi
+from htmltmpl import TemplateManager, TemplateProcessor
+import time
+from utils import unique
+import my_db
+from index import load_index
+import os
+from xbelimp import parse_xbel, import_bookmarks
+
+if (__name__ == "__main__"):
+    form = cgi.FieldStorage()
+    db = my_db.connect(os.environ["REMOTE_USER"])
+    file = form["xbelfile"].file
+    bms = parse_xbel(file)
+    import_bookmarks(db, bms)
+    load_index(db)