Re: Executing forms by instantiating GFInstance
"Adrian Maier" <[email protected]> Fri, 17 Nov 2006 16:11:03 +0200
| Newsgroups | gmane.comp.gnu.enterprise.general |
|---|---|
| Message-ID | <[email protected]> |
On 11/17/06, Jan Ischebeck <[email protected]> wrote: > Hi Adrian, > > I'm wondering about the error message, as gConfigDict should be created > by the constructor of GClientApp. > gConfigDict() is defined in GConfig.py, which is called in line 344 of > GBaseApp.py (in common/src/apps). > > If I call your application, I get the error that gConfigForms is > missing. This can be circumvented by adding the > following line to your constructor. > self.configurationManager.registerAlias ('gConfigForms', 'forms') thanks ... > Finally you still have to setup datasources to get your app working. > > Btw. which version of gnue are you using? GNUe Forms Version 0.5.16 GNUe Common Version 0.6.4 Cheers, Adrian Maier > > Adrian Maier schrieb: > > Hello, > > > > I am still trying (without much success) to execute a gfd form with > > the ability to > > specify programatically the file, the user and the password. I mean , > > i need to > > specify them in code, not on the command line. > > > > By instantiating the GFClient class i have been able to pass the file > > name > > with client.ARGUMENTS.append('form.gfd'). However, passing the user > > and the password in the same way proved to be impossible. > > > > Two days ago, i have been told that it should be possible to > > instantiate the > > GFInstance class. And that an example of how to do that can be found in > > gnue-navigator's sources. > > > > #!/usr/bin/python > > > > from gnue.forms.GFInstance import GFInstance > > from gnue.forms.uidrivers import wx as ui > > from gnue.forms.GFConfig import ConfigOptions > > from gnue.common.apps.GClientApp import GClientApp > > > > class gfdrunner(GClientApp): > > def __init__ (self, connections = None): > > GClientApp.__init__ (self, connections, 'forms', ConfigOptions) > > > > def run(self): > > instance = GFInstance(manager=self, > > connections=None, > > ui=ui, disableSplash=1) > > > > # instance.addFormFromFile('/home/am/src/gfaf/gnue/prod.gfd') > > # instance.activate() > > > > r = gfdrunner() > > r.run() > > > > Traceback (most recent call last): > > File "./run.py", line 42, in ? > > r.run() > > File "./run.py", line 34, in run > > ui=ui, disableSplash=1) > > File "/usr/local/gnue/lib/python/gnue/forms/GFInstance.py", line > > 153, in __init__ > > options = gConfigDict() > > NameError: global name 'gConfigDict' is not defined > > > > Any ideas about how to fix this ? > >