do_import.py
author fabien
Fri, 24 Oct 2003 17:04:29 -0400
branchxbelweb
changeset 47 2781ac85b807
parent 43 4d194fce51e1
permissions -rwxr-xr-x
[svn r1604] Implement default_view preferences, which move things around a lot.

#!/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
import time
from utils import unique
import my_db
from webutils 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"])
    prefs = db.get_preferences()
    file = form["xbelfile"].file
    bms = parse_xbel(file)
    import_bookmarks(db, bms)
    load_index(db, prefs)