Example #1
0
def set_dbproxy(dbUser, userName):
    b = Borg()
    dbPasswd = current_user.dbtoken

    dbUser = canonicalDbUser(dbUser)
    dbName = dbUser + '_default'
    db_proxy = MySQLDatabaseProxy(user=dbUser, passwd=dbPasswd, db=dbName)
    pSettings = db_proxy.getProjectSettings()

    id = b.init_settings()
    db_proxy.close()
    session['session_id'] = id
    b.settings[id]['dbProxy'] = db_proxy
    b.settings[id]['dbUser'] = dbUser
    b.settings[id]['userName'] = userName
    b.settings[id]['dbPasswd'] = dbPasswd
    b.settings[id]['dbHost'] = b.dbHost
    b.settings[id]['dbPort'] = b.dbPort
    b.settings[id]['dbName'] = dbName
    b.settings[id]['rPasswd'] = b.rPasswd
    b.settings[id]['fontSize'] = pSettings['Font Size']
    b.settings[id]['apFontSize'] = pSettings['AP Font Size']
    b.settings[id]['fontName'] = pSettings['Font Name']
    b.settings[id]['jsonPrettyPrint'] = False
    return b.settings[id]
Example #2
0
def set_dbproxy():
  b = Borg()
  db_proxy = MySQLDatabaseProxy()
  pSettings = db_proxy.getProjectSettings()

  id = b.init_settings()
  db_proxy.close()
  session['session_id'] = id
  b.settings[id]['dbProxy'] = db_proxy
  b.settings[id]['dbUser'] = b.dbUser
  b.settings[id]['dbPasswd'] = b.dbPasswd
  b.settings[id]['dbHost'] = b.dbHost
  b.settings[id]['dbPort'] = b.dbPort
  b.settings[id]['dbName'] = b.dbName
  b.settings[id]['fontSize'] = pSettings['Font Size']
  b.settings[id]['apFontSize'] = pSettings['AP Font Size']
  b.settings[id]['fontName'] = pSettings['Font Name']
  b.settings[id]['jsonPrettyPrint'] = False
  return b.settings[id]
Example #3
0
def set_dbproxy():
    b = Borg()
    db_proxy = MySQLDatabaseProxy()
    pSettings = db_proxy.getProjectSettings()

    id = b.init_settings()
    db_proxy.close()
    session['session_id'] = id
    b.settings[id]['dbProxy'] = db_proxy
    b.settings[id]['dbUser'] = b.dbUser
    b.settings[id]['dbPasswd'] = b.dbPasswd
    b.settings[id]['dbHost'] = b.dbHost
    b.settings[id]['dbPort'] = b.dbPort
    b.settings[id]['dbName'] = b.dbName
    b.settings[id]['fontSize'] = pSettings['Font Size']
    b.settings[id]['apFontSize'] = pSettings['AP Font Size']
    b.settings[id]['fontName'] = pSettings['Font Name']
    b.settings[id]['jsonPrettyPrint'] = False
    return b.settings[id]
Example #4
0
def set_dbproxy(dbUser,userName):
  b = Borg()
  dbName = dbUser + '_default'
  dbPasswd = current_user.dbtoken

  db_proxy = MySQLDatabaseProxy(user=dbUser,passwd=dbPasswd,db=dbName)
  pSettings = db_proxy.getProjectSettings()

  id = b.init_settings()
  db_proxy.close()
  session['session_id'] = id
  b.settings[id]['dbProxy'] = db_proxy
  b.settings[id]['dbUser'] = dbUser
  b.settings[id]['userName'] = userName
  b.settings[id]['dbPasswd'] = dbPasswd
  b.settings[id]['dbHost'] = b.dbHost
  b.settings[id]['dbPort'] = b.dbPort
  b.settings[id]['dbName'] = dbName
  b.settings[id]['rPasswd'] = b.rPasswd
  b.settings[id]['fontSize'] = pSettings['Font Size']
  b.settings[id]['apFontSize'] = pSettings['AP Font Size']
  b.settings[id]['fontName'] = pSettings['Font Name']
  b.settings[id]['jsonPrettyPrint'] = False
  return b.settings[id]