Hello,

Am 17.10.2010 18:22, schrieb Paul McNett:
> On 10/17/10 4:00 AM, Sibylle Koczian wrote:
>> Hello,
>>
>> I'm working through the AppWizard part of the PyCon2010 tutorial. When I
>> try to produce a QuickReport in expanded format from the application I
>> wrote myself, following the text of the tutorial, then I get this error:
>>
>> s...@gespenst-xubuntu:~/bin/dabotut/recipes_aw$ ./recipes_aw.py
>> Traceback (most recent call last):
>>      File "/home/sib/src/dabo-trunk/dabo/ui/uiwx/dToolBar.py", line 485,
>> in __onWxHit
>>        self.raiseEvent(dEvents.Hit)
>>      File "/home/sib/src/dabo-trunk/dabo/lib/eventMixin.py", line 92, in
>> raiseEvent
>>        bindingFunction(event)
>>      File "/home/sib/src/dabo-trunk/dabo/lib/datanav/Form.py", line 554,
>> in onQuickReport
>>        rfxml = self.getReportForm(mode)
>>      File "/home/sib/src/dabo-trunk/dabo/lib/datanav/Form.py", line 697,
>> in getReportForm
>>        return self.getAutoReportForm_expanded()
>>      File "/home/sib/src/dabo-trunk/dabo/lib/datanav/Form.py", line 896,
>> in getAutoReportForm_expanded
>>        "Alignment": o.Alignment.lower(),
>> AttributeError: 'int' object has no attribute 'lower'
>>
> The first question in my mind is, "what is object o?". So, I'd find the code 
> where
> the traceback occurs (dabo/lib/datanav/Form.py line 896), and on the line 
> above it
> place "print o, type(o)". Then I'd run the app again and I bet I'd be able to
> pinpoint from that information what object in my code is somehow assigning an 
> int
> value to the Alignment.
>
Well, this provided more new riddles than answers. Object o is used in a 
loop iterating through a list of the controls on the Edit page 
(PagRecipesEdit.py in this case). So the information is printed not only 
for the problem object but for all the objects coming before in the 
list. I added "o.Alignment" to the print statement and got:

Result:

<title (baseclass dabo.ui.dTextBox, id:-214)> <class 
'dabo.ui.uiwx.dTextBox.dTextBox'> Left
<subtitle (baseclass dabo.ui.dEditBox, id:-216)> <class 
'dabo.ui.uiwx.dEditBox.dEditBox'> Left
<ingred (baseclass dabo.ui.dEditBox, id:-218)> <class 
'dabo.ui.uiwx.dEditBox.dEditBox'> Left
<proced (baseclass dabo.ui.dEditBox, id:-220)> <class 
'dabo.ui.uiwx.dEditBox.dEditBox'> Left
<date (baseclass dabo.ui.dDateTextBox, id:-222)> <class 
'dabo.ui.uiwx.dDateTextBox.dDateTextBox'> Left
<CklCategoriesEdit (baseclass dabo.ui.dCheckList, id:-225)> <class 
'ui.CklCategories.CklCategoriesEdit'> 0
Traceback (most recent call last):
... (as before)

So CklCategoriesEdit or possible its base class seems to be the culprit?

And now it gets confusing: the original application doesn't produce the 
exception. But shouldn't it execute the print commands just the same? In 
fact, if I start it from a terminal window and run QuickReport, I only 
get this message:

** (evince:2153): WARNING **: Failed to create dbus proxy for 
org.gnome.SettingsDaemon: Could not get owner of name 
'org.gnome.SettingsDaemon': no such name

I think this only concerns evince, which seems to be called as the PDF 
viewer (I'm using XFCE as window manager). But where are the results of 
the print command? I put another print command at the beginning of 
method getAutoReportForm_expanded(): printed by my version of the 
application, not printed by the original.

I can think of two reasons for this: the results of the print command go 
to a log file (which I haven't yet found) or 
datanav.Form.getAutoReportForm_expanded() isn't used by the original 
application.

> As far as Alignment having int values, Dabo wouldn't have let that happen. 
> However,
> wxPython objects *do* have int values for their Alignment property (the 
> wx.RIGHT etc.
> constants are all ints). So, I bet you've instantiated a raw wxPython object
> somewhere which makes the code in datanav.Form fail.
>

Comparing the original CklCategories.py from the website with my version 
I find only trivial differences - certainly no instantiation of a raw 
wxPython object.

Very mystified,
Sibylle
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to