dabo Commit
Revision 5079
Date: 2009-02-25 16:29:39 -0800 (Wed, 25 Feb 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5079

Changed:
U   trunk/ide/PrefEditor.cdxml

Log:
Allow PrefEditor to edit arbitrary pref files. Just pass the full path and file 
name of the pref db.

Diff:
Modified: trunk/ide/PrefEditor.cdxml
===================================================================
--- trunk/ide/PrefEditor.cdxml  2009-02-25 22:26:08 UTC (rev 5078)
+++ trunk/ide/PrefEditor.cdxml  2009-02-26 00:29:39 UTC (rev 5079)
@@ -41,7 +41,16 @@
                </afterInit>
                <afterInitAll><![CDATA[
 def afterInitAll(self):
-       self.pref = dabo.dPref("")
+       import sys
+       db = None
+       if sys.argv[1:]:
+               db = sys.argv[1]
+       if db:
+               con = dabo.db.dConnection(dbType="sqlite", database=db)
+               cur = con.getDaboCursor()
+               self.pref = dabo.dPref(crs=cur, cxn=con)
+       else:
+               self.pref = dabo.dPref("")
        self.pref.AutoPersist = False
        self.pref._persistAll = True
        stru = self.pref.getPrefTree()



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to