[Top][All Lists]

[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 (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 (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).



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,
               ui=ui, disableSplash=1)


r = gfdrunner()

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

 User Name: am

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

reply via email to

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