All pastes #257690 Raw Edit

Something

public python v1 · immutable
#257690 ·published 2006-11-25 17:41 UTC
rendered paste body
import sys, ostry:    import pygtk    pythk.require("2.0")except:    passtry:    import gtk    import gtk.gladeexcept:    sys.exit(1)class bambotoo:    """Main  class loader"""    def __init__(self):        """initialises the variables, connects database et all """        print "Bambotoo admin: init ======================================"        self.gladeFile = "../glade_files/module_manager.glade"        self.debug = True        ## Modules directory        ## TODO: this need to be configuratble with a popup box and save to sile/xml/ini        self.modulesDir = "/home/bambotoo/bambotoo/trunk/modules/"        #self.modulesDir = "../../bambotoo/trunk/modules/"        print self.modulesDir        self.walktree(self.modulesDir)        ## Load the Glade MainWindow        self.wTree = gtk.glade.XML(self.gladeFile,'win-module-manager')    def walktree(path, depthfirst = True):        """Walk the directory tree, starting from top. Credit to Noah Spurrier and Doug Fort."""        print path        os.listdir(path)        return Noneif __name__ == "__main__":    bb = bambotoo()    gtk.main()