def main(args): qapp=QApplication(sys.argv) kuraapp.initApp(str(guiConf.username), str(guiConf.database), str(guiConf.password), str(guiConf.hostname)) kuraapp.initCurrentEnvironment(1, 1, 1) mainwin = QDialog() combobox = QComboBox(mainwin) comboproxy = ComboProxy(combobox, kuraapp.app.getObjects("lng_user"), guiConf.usernr) mainwin.show() qapp.connect(qapp, SIGNAL('lastWindowClosed()'), qapp, SLOT('quit()')) qapp.exec_loop()
def main(args): qapp=QApplication(args) kuraapp.initApp(str(guiConf.username), str(guiConf.database), str(guiConf.password), str(guiConf.hostname)) kuraapp.initCurrentEnvironment(1, 1, 1) app = kuraapp.app mainwin=GuiTable(None, None, None) mainwin.show() mainwin.refresh(app.createObject('lng_lex', fields={})) qapp.connect(qapp, SIGNAL('lastWindowClosed()'), qapp, SLOT('quit()')) qapp.setFont(QFont(guiConf.textfontfamily, guiConf.textfontsize), True) qapp.exec_loop()
def main(): kuraapp.initApp(str(guiConf.username), str(guiConf.database), str(guiConf.password), str(guiConf.hostname)) kuraapp.initCurrentEnvironment(guiConf.usernr, guiConf.languagenr, guiConf.projectnr) app=QApplication(sys.argv) view=KuraTextCanvas() view.setTextByNumber(1) view.show() app.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()')) app.exec_loop()
guiConf.datastore)) elif guiConf.backend == guiconfig.SQL: if guiConf.username != "": try: kuraapp.initApp(guiConf.backend, username = str(guiConf.username), database = str(guiConf.database), password = str(guiConf.password), hostname = str(guiConf.hostname)) except Exception, e: print "Error connecting to database: %s" % e sys.exit(1) kuraapp.initCurrentEnvironment(guiConf.usernr, guiConf.languagenr, guiConf.projectnr) def main(args): if len(args) < 2: print "Usage: python script5.py f1...fn" sys.exit(1) init() for line in codecs.open(args[1], "r", "UTF-8"): line = splitCSVLine(line) print "Inserting %s" % line[0] lexeme = kuraapp.app.createObject("lng_lex", fields={}, form = line[0], glosse = line[1], languagenr = guiConf.languagenr,
import codecs, sys, os sys.setappdefaultencoding("utf-8") True = 1 False = 0 from kuragui.guiconfig import guiConf from dbobj.textdb import textquery from kuralib import kuraapp kuraapp.initApp("dbSql", username = str(guiConf.username), database = sys.argv[1], password = str(guiConf.password), hostname = str(guiConf.hostname)) kuraapp.initCurrentEnvironment(1,1,1) textdb = textquery.TextQuery(kuraapp.app, sys.argv[v]) for table, tabledef in kuraapp.app.tables.items(): print "Converting", table records = kuraapp.app.getObjects(table) for r in records: textdb.insert(table, r, False) textdb.saveDatabase()