def __init__(self, guiapp): self.guiapp = guiapp self.ok = False import gui self.dialog = gui.Dialog("Import XHTML") self.dialog.addLabel(self.dialog, "Import data from a XHTML-file to a KexiDB table.\n" "The destination table needs to be an existing table the data should be added to.") self.importfile = self.dialog.addFileChooser(self.dialog, "Source File:", gui.getHome() + "/kexidata.xhtml", (('XHTML files', '*.xhtml'),('All files', '*'))) self.desttable = self.dialog.addList(self.dialog, "Destination Table:", self.guiapp.outputwriter.getTables()) #self.operation = self.dialog.addList(self.dialog, "Operation:", ("Insert","Update","Insert/Update")) #self.error = self.dialog.addList(self.dialog, "On error:", ("Ask","Skip","Abort")) self.logfile = self.dialog.addFileChooser(self.dialog, "Log File:", "", (('Logfiles', '*.log'),('All files', '*'))) btnframe = self.dialog.addFrame(self.dialog) self.dialog.addButton(btnframe, "Next", self.doNext) self.dialog.addButton(btnframe, "Cancel", self.doCancel) self.dialog.show()
def __init__(self, datasource): self.datasource = datasource try: import gui except: raise "Import of the Kross GUI module failed." self.dialog = gui.Dialog("Export XHTML") self.dialog.addLabel(self.dialog, "Export a table- or query-datasource to a XHTML-file.") datasourceitems = self.datasource.getSources() self.datasourcelist = self.dialog.addList(self.dialog, "Datasource:", datasourceitems) styleitems = ["Plain", "Paper", "Blues"] self.stylelist = self.dialog.addList(self.dialog, "Style:", styleitems) #queryframe = Tkinter.Frame(frame) #queryframe.pack() #Tkinter.Label(queryframe, text="Table or query to export:").pack(side=Tkinter.LEFT) #self.querycontent = Tkinter.StringVar() #self.query = apply(Tkinter.OptionMenu, (queryframe, self.querycontent) + tuple( self.datasource.getSources() )) #self.query.pack(side=Tkinter.LEFT) self.file = self.dialog.addFileChooser(self.dialog, "File:", gui.getHome() + "/kexidata.xhtml", (('XHTML files', '*.xhtml'),('All files', '*'))) btnframe = self.dialog.addFrame(self.dialog) self.dialog.addButton(btnframe, "Export", self.doExport) self.dialog.addButton(btnframe, "Cancel", self.dialog.close) self.dialog.show()
def __init__(self, dataprovider): self.dataprovider = dataprovider try: import gui except: raise "Import of the Kross GUI module failed." self.dialog = gui.Dialog("Project Documentor") self.dialog.addLabel(self.dialog, "Save information about the project to an HTML file.") self.file = self.dialog.addFileChooser(self.dialog, "File:", gui.getHome() + "/projectdoc.html", (('HTML files', '*.html'),('All files', '*'))) self.printCheckBoxes = {} for d in dir(self.dataprovider): if d.startswith("print"): self.printCheckBoxes[d] = self.dialog.addCheckBox(self.dialog, d[5:], True) #value = getattr(self.dataprovider,d)() #if value != None and len(value) > 0: # f.write("<h2>%s</h2>" % d[5:]) # f.write( self.toHTML(value) ) #self.exportProjectdetails = #self.exportTableschemas = self.dialog.addCheckBox(self.dialog, "Table schemas", True) #self.exportQueryschemas = self.dialog.addCheckBox(self.dialog, "Query schemas", True) btnframe = self.dialog.addFrame(self.dialog) self.dialog.addButton(btnframe, "Save", self.doSave) self.dialog.addButton(btnframe, "Cancel", self.dialog.close) self.dialog.show()