[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7293 - trunk/gnue-forms/samples/connections
From: |
reinhard |
Subject: |
[gnue] r7293 - trunk/gnue-forms/samples/connections |
Date: |
Mon, 4 Apr 2005 16:54:12 -0500 (CDT) |
Author: reinhard
Date: 2005-04-04 16:54:11 -0500 (Mon, 04 Apr 2005)
New Revision: 7293
Modified:
trunk/gnue-forms/samples/connections/connection.gfd
Log:
Adapted connection.gfd to new inifile driver.
Modified: trunk/gnue-forms/samples/connections/connection.gfd
===================================================================
--- trunk/gnue-forms/samples/connections/connection.gfd 2005-04-04 21:51:54 UTC
(rev 7292)
+++ trunk/gnue-forms/samples/connections/connection.gfd 2005-04-04 21:54:11 UTC
(rev 7293)
@@ -1,190 +1,190 @@
-<?xml version="1.0" encoding="iso8859-1"?>
-
-<!-- GNUe-Designer (0.5.3.99)
- Saved on: 2004-04-04 15:24:39 -->
-
-<form title="Editor for Connection Settings">
+<?xml version="1.0" encoding="iso8859-1"?>
+
+<!-- GNUe-Designer (0.5.3.99)
+ Saved on: 2004-04-04 15:24:39 -->
+
+<form title="Editor for Connection Settings">
<trigger type="on-activation">
blkUnbound.fldUI = getParameter('ui')
</trigger>
- <connection name="connection_config" comment=""
- dbname="%configdir%/connections.conf" host=""
provider="special.configfile"/>
- <datasource name="connection_dtsrc" connection="connection_config"/>
- <datasource name="dtsDrpProvider" type="static">
- <staticset fields="provider,descr">
- <staticsetrow>
- <staticsetfield name="provider" value="adodbapi"/>
- <staticsetfield name="descr" value="MS ADO"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="appserver"/>
- <staticsetfield name="descr" value="GNUe appserver"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="cxoracle"/>
- <staticsetfield name="descr" value="Oracle (cxoracle)"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="db2"/>
- <staticsetfield name="descr" value="DB2"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="dcoracle"/>
- <staticsetfield name="descr" value="Oracle (dcoracle)"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="gadfly"/>
- <staticsetfield name="descr" value="Gadfly"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="informix"/>
- <staticsetfield name="descr" value="Informix"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="ingres"/>
- <staticsetfield name="descr" value="Ingres"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="interbase"/>
- <staticsetfield name="descr" value="Interbase/Firebird"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="wodbc"/>
- <staticsetfield name="descr" value="PythonWin ODBC"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="mysql"/>
- <staticsetfield name="descr" value="MySql"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="popy"/>
- <staticsetfield name="descr" value="Postgresql (popy)"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="pygresql"/>
- <staticsetfield name="descr" value="Postgresql (pygresql)"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="psycopg"/>
- <staticsetfield name="descr" value="Postgresql (psycopg)"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="pypgsql"/>
- <staticsetfield name="descr" value="Postgresql (pypgsql)"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="sapdb"/>
- <staticsetfield name="descr" value="SAP-DB/MaxDB"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="sqlite"/>
- <staticsetfield name="descr" value="SQLite"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="sqlrelay"/>
- <staticsetfield name="descr" value="SQLRelay"/>
- </staticsetrow>
- <staticsetrow>
- <staticsetfield name="provider" value="sybase"/>
- <staticsetfield name="descr" value="Sybase"/>
- </staticsetrow>
- </staticset>
- </datasource>
- <logic>
+ <connection name="connection_config" comment=""
+ dbname="%(configdir)s/connections.conf" host=""
provider="inifile"/>
+ <datasource name="connection_dtsrc" connection="connection_config"/>
+ <datasource name="dtsDrpProvider" type="static">
+ <staticset fields="provider,descr">
+ <staticsetrow>
+ <staticsetfield name="provider" value="adodbapi"/>
+ <staticsetfield name="descr" value="MS ADO"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="appserver"/>
+ <staticsetfield name="descr" value="GNUe appserver"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="cxoracle"/>
+ <staticsetfield name="descr" value="Oracle (cxoracle)"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="db2"/>
+ <staticsetfield name="descr" value="DB2"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="dcoracle"/>
+ <staticsetfield name="descr" value="Oracle (dcoracle)"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="gadfly"/>
+ <staticsetfield name="descr" value="Gadfly"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="informix"/>
+ <staticsetfield name="descr" value="Informix"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="ingres"/>
+ <staticsetfield name="descr" value="Ingres"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="interbase"/>
+ <staticsetfield name="descr" value="Interbase/Firebird"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="wodbc"/>
+ <staticsetfield name="descr" value="PythonWin ODBC"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="mysql"/>
+ <staticsetfield name="descr" value="MySql"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="popy"/>
+ <staticsetfield name="descr" value="Postgresql (popy)"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="pygresql"/>
+ <staticsetfield name="descr" value="Postgresql (pygresql)"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="psycopg"/>
+ <staticsetfield name="descr" value="Postgresql (psycopg)"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="pypgsql"/>
+ <staticsetfield name="descr" value="Postgresql (pypgsql)"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="sapdb"/>
+ <staticsetfield name="descr" value="SAP-DB/MaxDB"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="sqlite"/>
+ <staticsetfield name="descr" value="SQLite"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="sqlrelay"/>
+ <staticsetfield name="descr" value="SQLRelay"/>
+ </staticsetrow>
+ <staticsetrow>
+ <staticsetfield name="provider" value="sybase"/>
+ <staticsetfield name="descr" value="Sybase"/>
+ </staticsetrow>
+ </staticset>
+ </datasource>
+ <logic>
<block name="blkUnbound">
</block>
- <block name="Block_1" datasource="connection_dtsrc">
- <field name="SecE" field="_section_name">
- <options>
- <option name="tip"
- value="Name of the connection, as it is used in the
datasource tag."/>
- </options>
- </field>
- <field name="aliasE" field="aliases">
- <options>
- <option name="tip"
- value="A space seperated list of aliases for this
connection."/>
- </options>
- </field>
- <field name="provE" field="provider" fk_description="descr"
- fk_key="provider" fk_source="dtsDrpProvider"/>
- <field name="descrE" field="comment"/>
- <field name="hostE" field="host"/>
- <field name="portE" field="port"/>
- <field name="dbE" field="dbname"/>
- <field name="encE" field="encoding"/>
- <field name="rpctE" field="rpctype"/>
- <field name="tranE" field="transport"/>
- <field name="servE" field="service"/>
- </block>
- </logic>
- <layout xmlns:Char="GNUe:Layout:Char" Char:height="19" Char:width="50">
- <page name="Conn">
- <label name="Label_1" Char:height="1" Char:width="30" Char:x="6"
- Char:y="1" text="Editor for Connection Settings"/>
- <box name="setbox" Char:height="13" Char:width="48" Char:x="1"
- Char:y="4" label="Settings"/>
- <label name="SecL" Char:height="1" Char:width="16" Char:x="2" Char:y="3"
- text="Connection name:"/>
- <label name="aliasL" Char:height="1" Char:width="15" Char:x="2"
- Char:y="6" text="Aliases (opt.):"/>
- <label name="provL" Char:height="1" Char:width="16" Char:x="2"
- Char:y="7" text="Provider (req.):"/>
- <label name="descrL" Char:height="1" Char:width="12" Char:x="2"
- Char:y="8" text="Comment:"/>
- <label name="hostL" Char:height="1" Char:width="5" Char:x="2" Char:y="9"
- text="Host:"/>
- <label name="portL" Char:height="1" Char:width="9" Char:x="2"
- Char:y="10" text="Port:"/>
- <label name="dbL" Char:height="1" Char:width="9" Char:x="2" Char:y="11"
- text="Database:"/>
- <label name="encL" Char:height="1" Char:width="9" Char:x="2" Char:y="13"
- text="Encoding:"/>
- <label name="rpctL" Char:height="1" Char:width="19" Char:x="2"
- Char:y="14" text="RPC type (appsrv.):"/>
- <label name="transL" Char:height="1" Char:width="20" Char:x="2"
- Char:y="15" text="Transport (appsrv.):"/>
- <label name="servL" Char:height="1" Char:width="9" Char:x="2"
- Char:y="12" text="Service:"/>
- <entry name="Entry1" Char:height="1" Char:width="25" Char:x="22"
- Char:y="3" block="Block_1" field="SecE" label=""/>
- <entry name="Entry2" Char:height="1" Char:width="25" Char:x="22"
- Char:y="6" block="Block_1" field="aliasE" label=""/>
- <entry name="Entry3" Char:height="1" Char:width="25" Char:x="22"
- Char:y="7" block="Block_1" field="provE" label=""
style="dropdown"/>
- <entry name="Entry4" Char:height="1" Char:width="25" Char:x="22"
- Char:y="8" block="Block_1" field="descrE" label=""/>
- <entry name="Entry5" Char:height="1" Char:width="25" Char:x="22"
- Char:y="9" block="Block_1" field="hostE" label=""/>
- <entry name="Entry6" Char:height="1" Char:width="25" Char:x="22"
- Char:y="10" block="Block_1" field="portE" label=""/>
- <entry name="Entry7" Char:height="1" Char:width="25" Char:x="22"
- Char:y="11" block="Block_1" field="dbE" label=""/>
- <entry name="Entry8" Char:height="1" Char:width="25" Char:x="22"
- Char:y="13" block="Block_1" field="encE" label=""/>
- <entry name="Entry9" Char:height="1" Char:width="25" Char:x="22"
- Char:y="14" block="Block_1" field="rpctE" label=""/>
- <entry name="Entry10" Char:height="1" Char:width="25" Char:x="22"
- Char:y="15" block="Block_1" field="tranE" label=""/>
- <entry name="Entry11" Char:height="1" Char:width="25" Char:x="22"
- Char:y="12" block="Block_1" field="servE" label=""/>
- <button name="TestConnection" Char:height="1" Char:width="17"
- Char:x="30" Char:y="17" label="Test connection">
+ <block name="Block_1" datasource="connection_dtsrc">
+ <field name="SecE" field="_section_name">
+ <options>
+ <option name="tip"
+ value="Name of the connection, as it is used in the
datasource tag."/>
+ </options>
+ </field>
+ <field name="aliasE" field="aliases">
+ <options>
+ <option name="tip"
+ value="A space seperated list of aliases for this
connection."/>
+ </options>
+ </field>
+ <field name="provE" field="provider" fk_description="descr"
+ fk_key="provider" fk_source="dtsDrpProvider"/>
+ <field name="descrE" field="comment"/>
+ <field name="hostE" field="host"/>
+ <field name="portE" field="port"/>
+ <field name="dbE" field="dbname"/>
+ <field name="encE" field="encoding"/>
+ <field name="rpctE" field="rpctype"/>
+ <field name="tranE" field="transport"/>
+ <field name="servE" field="service"/>
+ </block>
+ </logic>
+ <layout xmlns:Char="GNUe:Layout:Char" Char:height="19" Char:width="50">
+ <page name="Conn">
+ <label name="Label_1" Char:height="1" Char:width="30" Char:x="6"
+ Char:y="1" text="Editor for Connection Settings"/>
+ <box name="setbox" Char:height="13" Char:width="48" Char:x="1"
+ Char:y="4" label="Settings"/>
+ <label name="SecL" Char:height="1" Char:width="16" Char:x="2" Char:y="3"
+ text="Connection name:"/>
+ <label name="aliasL" Char:height="1" Char:width="15" Char:x="2"
+ Char:y="6" text="Aliases (opt.):"/>
+ <label name="provL" Char:height="1" Char:width="16" Char:x="2"
+ Char:y="7" text="Provider (req.):"/>
+ <label name="descrL" Char:height="1" Char:width="12" Char:x="2"
+ Char:y="8" text="Comment:"/>
+ <label name="hostL" Char:height="1" Char:width="5" Char:x="2" Char:y="9"
+ text="Host:"/>
+ <label name="portL" Char:height="1" Char:width="9" Char:x="2"
+ Char:y="10" text="Port:"/>
+ <label name="dbL" Char:height="1" Char:width="9" Char:x="2" Char:y="11"
+ text="Database:"/>
+ <label name="encL" Char:height="1" Char:width="9" Char:x="2" Char:y="13"
+ text="Encoding:"/>
+ <label name="rpctL" Char:height="1" Char:width="19" Char:x="2"
+ Char:y="14" text="RPC type (appsrv.):"/>
+ <label name="transL" Char:height="1" Char:width="20" Char:x="2"
+ Char:y="15" text="Transport (appsrv.):"/>
+ <label name="servL" Char:height="1" Char:width="9" Char:x="2"
+ Char:y="12" text="Service:"/>
+ <entry name="Entry1" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="3" block="Block_1" field="SecE" label=""/>
+ <entry name="Entry2" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="6" block="Block_1" field="aliasE" label=""/>
+ <entry name="Entry3" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="7" block="Block_1" field="provE" label=""
style="dropdown"/>
+ <entry name="Entry4" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="8" block="Block_1" field="descrE" label=""/>
+ <entry name="Entry5" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="9" block="Block_1" field="hostE" label=""/>
+ <entry name="Entry6" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="10" block="Block_1" field="portE" label=""/>
+ <entry name="Entry7" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="11" block="Block_1" field="dbE" label=""/>
+ <entry name="Entry8" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="13" block="Block_1" field="encE" label=""/>
+ <entry name="Entry9" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="14" block="Block_1" field="rpctE" label=""/>
+ <entry name="Entry10" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="15" block="Block_1" field="tranE" label=""/>
+ <entry name="Entry11" Char:height="1" Char:width="25" Char:x="22"
+ Char:y="12" block="Block_1" field="servE" label=""/>
+ <button name="TestConnection" Char:height="1" Char:width="17"
+ Char:x="30" Char:y="17" label="Test connection">
<trigger type="ON-ACTION" name="TestConnection"><![CDATA[##
from gnue.common.utils.FileUtils import dyn_import
if blkUnbound.fldUI:
myLoginHandler = dyn_import('gnue.forms.uidrivers.%s.UILoginHandler'
%blkUnbound.fldUI)
else:
from gnue.forms.uidrivers.wx import UILoginHandler as myLoginHandler
-
+
from gnue.common.datasources.GConnections import GConnections
from gnue.common.datasources.GDataObjects import LoginError
from gnue.common.apps.plugin import find, LoadError
-
+
name = Block_1.SecE.get()
provider = Block_1.provE.get()
-try:
+try:
base = 'gnue.common.datasources.drivers'
testDriver = find(provider, base, 'Connection')
print 'provider', provider, "OK"
@@ -195,34 +195,34 @@
modal = 1
activateDialog('messageDialog',parameters,modal)
return
-
-try:
- connections = GConnections('')
-
- lh = myLoginHandler()
- param = lh.getLogin([name,name, [('_username', 'Username', False),
+
+try:
+ connections = GConnections('')
+
+ lh = myLoginHandler()
+ param = lh.getLogin([name,name, [('_username', 'Username', False),
('_password', 'Password', True)]])
-
- param['host'] = Block_1.hostE.get()
+
+ param['host'] = Block_1.hostE.get()
param['port'] = Block_1.portE.get()
- param['dbname'] = Block_1.dbE.get()
+ param['dbname'] = Block_1.dbE.get()
param['encoding'] = Block_1.encE.get()
param['rpctype'] = Block_1.rpctE.get()
param['transport'] = Block_1.tranE.get()
param['service'] = Block_1.servE.get()
-
+
try:
- conn = testDriver.Connection(connections, name, param)
+ conn = testDriver.Connection(connections, name, param)
except:
- conn = testDriver.Connection.Connection(connections, name, param)
- conn.connect(param)
- print 'Connection to ', name, " is OK."
+ conn = testDriver.Connection.Connection(connections, name, param)
+ conn.connect(param)
+ print 'Connection to ', name, " is OK."
parameters = {'message':'Connection to %s is OK' %name}
modal = 1
activateDialog('messageDialog',parameters,modal)
-
-except LoginError, arg:
+
+except LoginError, arg:
print arg
parameters = {'message':arg}
@@ -231,9 +231,9 @@
connections.closeAll()
-]]></trigger>
- </button>
- </page>
+]]></trigger>
+ </button>
+ </page>
</layout>
<dialog xmlns:c="GNUe:Layout:Char" name="messageDialog">
@@ -265,5 +265,5 @@
</page>
</layout>
</dialog>
-
-</form>
+
+</form>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7293 - trunk/gnue-forms/samples/connections,
reinhard <=