예제 #1
0
def init():
    if guiConf.backend == guiconfig.FILE:
        kuraapp.initApp(guiConf.backend,
                        dbfile = os.path.join(guiConf.filepath,
                                              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)
예제 #2
0
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()
예제 #3
0
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()
예제 #4
0
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()
예제 #5
0
import os.path, sys
from kuralib import kuraapp
from kuragui.guiconfig import guiConf
from kuragui import guiconfig

if guiConf.backend == guiconfig.FILE:
    kuraapp.initApp(guiConf.backend,
                    dbfile = os.path.join(guiConf.filepath, 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)

rows = kuraapp.app.getObjects("lng_element",,
                              streamnr = 1)
for row in rows:
    print row.form, row.glosse
예제 #6
0
from os import path, environ
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()