gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUe] Working example for calling a specific form from a python scr


From: Jan Ischebeck
Subject: Re: [GNUe] Working example for calling a specific form from a python script
Date: Fri, 17 Nov 2006 15:42:57 +0100
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Hi Adrian,

to remove the annoying text mode user/password questions you can use the SilentLoginHandler.

Add to imports:
from gnue.common.datasources.GLoginHandler import SilentLoginHandler

Add to constructor:
loginHandler = SilentLoginHandler (_username = user, _password = paswd)
self.connections.setLoginHandler (loginHandler)

An example can be found in GeasRpcServer.py (in appserver/src)

Regards, Jan

Adrian Maier schrieb:
On 11/17/06, Jan Ischebeck <address@hidden> wrote:
Hi Adrian,

the following example is working for me (latest development version).

Jan

#!/usr/bin/python

from gnue.forms.GFInstance import GFInstance
from gnue.forms.uidrivers import wx26 as ui
from gnue.forms.GFConfig import ConfigOptions
from gnue.common.apps.GClientApp import GClientApp

class gfdrunner(GClientApp):
  def __init__ (self, connections = None):
    self.OPTIONS['username'] = "myname"
    self.OPTIONS['password'] = "mypassword"
    GClientApp.__init__ (self, connections, 'forms', ConfigOptions)

    self.configurationManager.registerAlias ('gConfigForms', 'forms')

  def run(self):
    instance = GFInstance(manager=self,
               connections=self.connections,
               ui=ui, disableSplash=1)

    instance.addFormFromFile('F:\gnue\samples\gauntlet.gfd')
    instance.activate()

r = gfdrunner()
r.run()

Hello Jan,

This script works here, too. But it asked me for a username and password,
in console mode :

************************************************************
GNU Enterprise: Login to db_faf

 Login required for
"DB_FAF"

 User Name: am
 Password:

Then the form started with the wx ui. A little strange, but it's an important
step forward:  the form ran !

James had explained me a couple of days ago, on irc, that it's necessary to define a login manager class that returns the user and password. I'll try doing
that next.


Thanks !

Adrian Maier


_______________________________________________
Gnue mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnue





reply via email to

[Prev in Thread] Current Thread [Next in Thread]