On Wed, 2006-09-20 at 20:30 -0700, Paul McNett wrote:
> ----- Original Message -----
> From: Brian Snipes
> [mailto:[EMAIL PROTECTED]
> To: Dabo Users list
> [mailto:[EMAIL PROTECTED]
> Sent: Wed, 20 Sep 2006 18:58:17 -0700
> Subject:
> Re: [dabo-users] Problem with AppWizard in current svn?
>
>
> > On Wed, 2006-09-20 at 19:45 -0500, Brian Snipes wrote:
> > > On Sun, 2006-09-17 at 16:26 -0400, Ed Leafe wrote:
> > > > On Sep 17, 2006, at 12:17 PM, Brian Snipes wrote:
> > > >
> > > > > Running OpenSuSE 10.1. I just tried to connect to a test.db file and
> > > > > use the AppWizard to connect to a test SQLite db and got an error when
> > > > > clicking the Finish button. I created the db from within the Python
> > > > > interpreter after running "import sqlite". I am trying to learn
> > > > > Python
> > > > > which is why it was created the 'hard' way :-)
> > > > > Any thoughts?
> > > >
> > > > I've seen that too, and will look into a fix tomorrow when I
> > > > return
> > > > home.
> > > >
> > > > -- Ed Leafe
> > >
> > > I've been doing some testing and it looks like the problem I am seeing
> > > is when substition occurs in the spec-main.py.txt file which is being
> > > loaded in getMain(). The following line in spec-main.py.txt throws up
> > > the error when trying to substitute:
> > >
> > > formsToOpen.append(getattr(ui, "Frm%s" % form_name))
> > >
> > > Am I correct that this line shouldn't have substition performed on it
> > > from the getMain() in AppWizard.py? If so, how can I tell getMain() not
> > > to do substition on this line in the txt file when reading it?
> > >
> > > Thanks,
> > > Brian
> >
> > Ok. More reading and studying and testing. After reading
> > http://svn.python.org/projects/peps/trunk/pep-0292.txt I decided to try
> > it's template method as a test on the spec-main.py.txt file. Using
> > Template from the string module and using the ${var} substitution format
> > looks like it might solve the problem with the AppWizard. Would my
> > going through and modifying the template files and the AppWizard.py to
> > use Template be a good thing to do ( and submit back ) or would it be
> > best to wait for a better solution to this?
>
> Hi Brian, I think that using Template would be a good thing, and would
> encourage you to submit a patch for it. However, I'm confused as to the
> problem you are having, which I thought from the prior messages was
> SQLite-related. I only very recently edited spec-main.py.txt tweaking the
> section that is causing you trouble. It was this commit:
>
> ------------------------------------------------------------------------
> r635 | paul | 2006-09-15 12:12:52 -0700 (Fri, 15 Sep 2006) | 7 lines
>
> Added the ability to pass form names to the main script of generated apps,
> so that the user can choose which form or forms to start with. For instance,
> if there are FrmCustomers and FrmInvoices in the ui package, and
> FrmCustomers is set to be the default form when starting the app, you could
> send "invoices" on the command line to start up FrmInvoices instead. Or,
> send both "invoices" and "customers" to get both.
>
> ------------------------------------------------------------------------
>
> So, the first step would be to:
>
> svn up -r 634 spec-main.py.txt
>
> and see if that fixes your problem. If it does, could you send me the
> traceback you are seeing with the 635 change since I don't seem to be having
> any trouble with it.
>
> Thanks!
> -Paul
Hi Paul. After trying with SQLite on my laptop I decided to test the
AppWizard against a PostgreSQL db at work and got the same errors.
That's when I started digging into it some more. Attached is a tar.gz
of the AppWizard directory with changes made to use Template that works
for me. The following is my traceback from the 2 versions of
spec-main.py.txt. The 634 revision works fine but the 635 doesn't.
This is from connection to a PostgreSQL db.
Thanks!
Brian
[EMAIL PROTECTED] AppWizard]$ svn up -r 634 spec-main.py.txt
U spec-main.py.txt
Updated to revision 634.
[EMAIL PROTECTED] AppWizard]$ ./AppWizard.py
Dabo Info Log: Thu Sep 21 08:02:50 2006: 0 database connection
definition(s) loaded.
Dabo Info Log: Thu Sep 21 08:02:50 2006: User interface already set to
'wx', so dApp didn't touch it.
Dabo Info Log: Thu Sep 21 08:02:50 2006: wxPython Version: 2.6.3.2 wxGTK
(unicode) (gtk2)
[EMAIL PROTECTED] AppWizard]$ svn up -r 635 spec-main.py.txt
U spec-main.py.txt
Updated to revision 635.
[EMAIL PROTECTED] AppWizard]$ ./AppWizard.py
Dabo Info Log: Thu Sep 21 08:03:11 2006: 0 database connection
definition(s) loaded.
Dabo Info Log: Thu Sep 21 08:03:11 2006: User interface already set to
'wx', so dApp didn't touch it.
Dabo Info Log: Thu Sep 21 08:03:11 2006: wxPython Version: 2.6.3.2 wxGTK
(unicode) (gtk2)
Traceback (most recent call last):
File "/home/bsnipes/bin/dabo/lib/eventMixin.py", line 97, in
raiseEvent
bindingFunction(event)
File "/home/bsnipes/bin/dabo/ui/dialogs/Wizard.py", line 122, in
onNext
self._finish()
File "/home/bsnipes/bin/dabo/ui/dialogs/Wizard.py", line 138, in
_finish
ok = pg.onLeavePage("forward")
File "./AppWizard.py", line 682, in onLeavePage
if not self.Form.createApp():
File "./AppWizard.py", line 759, in createApp
f.write(self.getMain(ci.Name, selTb[0]))
File "./AppWizard.py", line 1148, in getMain
"spec-main.py.txt")).read() % locals()
TypeError: not enough arguments for format string
[EMAIL PROTECTED] AppWizard]$
--- StripMime Report -- processed MIME parts ---
multipart/mixed
multipart/alternative
text/plain (text body -- kept)
text/html
application/x-compressed-tar
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users