Module Import alias Import alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Num ImportFrom alias Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Num Str Str Print NameLoad Str For TupleStore NameStore TupleStore NameStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad body If CompareNotEq NameLoad Num body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Str Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Print NameLoad Str Print NameLoad Print NameLoad Str
N/A N/A sys N/A os.path N/A N/A N/A N/A sys path insert 0 N/A N/A N/A os path dirname N/A N/A N/A os path dirname N/A N/A sys argv N/A 0 dbaccess connect N/A db N/A connect N/A cursor N/A N/A db cursor N/A N/A N/A cursor execute SELECT item, type, default_integer, default_string, description FROM preferences N/A preferences N/A N/A cursor fetchall N/A installpreferences_py N/A open N/A N/A N/A os path join N/A N/A N/A os path dirname N/A N/A sys argv N/A 0 installpreferences.py w N/A installpreferences_py PREFERENCES = [  N/A N/A index N/A item type default_integer default_string description N/A enumerate preferences N/A N/A N/A index 0 N/A N/A N/A N/A installpreferences_py write ,
                 N/A N/A N/A installpreferences_py write N/A { "item": %r,
                  "type": %r, N/A item type N/A N/A type string N/A N/A N/A N/A installpreferences_py write N/A 
                  "default_string": %r, default_string N/A N/A N/A N/A installpreferences_py write N/A 
                  "default_integer": %r, default_integer N/A N/A N/A installpreferences_py write N/A 
                  "description": %r } description N/A installpreferences_py  ] N/A installpreferences_py N/A installpreferences_py def installPreferences(db, quiet): N/A installpreferences_py     cursor = db.cursor() N/A installpreferences_py N/A installpreferences_py     for preference in PREFERENCES: N/A installpreferences_py         item = preference["item"] N/A installpreferences_py         type = preference["type"] N/A installpreferences_py         default_integer = preference.get("default_integer") N/A installpreferences_py         default_string = preference.get("default_string") N/A installpreferences_py         description = preference["description"] N/A installpreferences_py N/A installpreferences_py         cursor.execute("SELECT 1 FROM preferences WHERE item=%s", (item,)) N/A installpreferences_py N/A installpreferences_py         if cursor.fetchone(): N/A installpreferences_py             if not quiet: print "Updating: %s" % item N/A installpreferences_py             cursor.execute("UPDATE preferences SET type=%s, default_integer=%s, default_string=%s, description=%s WHERE item=%s", (type, default_integer, default_string, description, item)) N/A installpreferences_py         else: N/A installpreferences_py             if not quiet: print "Adding:   %s" % item N/A installpreferences_py             cursor.execute("INSERT INTO preferences (item, type, default_integer, default_string, description) VALUES (%s, %s, %s, %s, %s)", (item, type, default_integer, default_string, description)) N/A installpreferences_py N/A installpreferences_py if __name__ == "__main__": N/A installpreferences_py     import sys N/A installpreferences_py     import os.path N/A installpreferences_py N/A installpreferences_py     sys.path.insert(0, os.path.dirname(os.path.dirname(sys.argv[0]))) N/A installpreferences_py N/A installpreferences_py     import dbaccess N/A installpreferences_py N/A installpreferences_py     db = dbaccess.connect() N/A installpreferences_py N/A installpreferences_py     installPreferences(db, "--quiet" in sys.argv or "-q" in sys.argv) N/A installpreferences_py N/A installpreferences_py     db.commit()