Over in dabo-users I found this recently:
Traceback (most recent call last):
File "/home/sib/src/neues_dabo2/dabo/ui/uiwx/dControlMixin.py", line
27, in _onWxHit
self.raiseEvent(dEvents.Hit, evt, *args, **kwargs)
File "/home/sib/src/neues_dabo2/dabo/ui/uiwx/dPemMixin.py", line
1086, in raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
**kwargs)
File "/home/sib/src/neues_dabo2/dabo/lib/eventMixin.py", line 81, in
raiseEvent
bindingFunction(event)
File "./testnumtx_sqlite.py", line 96, in onNext
self.next()
File "/home/sib/src/neues_dabo2/dabo/ui/uiwx/dForm.py", line 362, in next
self._moveRecordPointer(bizobj.__next__, dataSource)
File "/home/sib/src/neues_dabo2/dabo/ui/uiwx/dForm.py", line 271, in
_moveRecordPointer
response = func(*args, **kwargs)
File "/home/sib/src/neues_dabo2/dabo/biz/dBizobj.py", line 359, in
__next__
next(self._CurrentCursor)
StopIteration
So looking at that, it seems that we are calling
next(self._CurrentCursor) but not handling the case when StopIteration
is raised. Dabo needs to handle that if I understand correctly.
Paul
On 5/6/16 12:06 PM, Paul McNett wrote:
On 5/5/16 5:11 PM, john wrote:
Hi Paul and Ed,
Something I have never understood is the why and how the next() works in
Dabo.
First, why didn't you change the name to something that did not conflict
with the Iteration next() (something like nnext()). Every time I have
trouble with using next with my cursors I run into:
StopIteration:
Dabo was written before (right before) generators were formalized in
python.
We should rewrite dabo's dCursor and dBizobj to be native iterators, and
get rid of the next(), prior(), etc. but barring that renaming next()
seems necessary. Unfortunately, this will likely break user code.
This is not a Traceback but an exception for some iteration somewhere -
who knows where. But I can't trace it because I can't determine where
it's coming from - there is no Try:/Except anywhere associated with
cursor.next(). I have been lucky that I always used some work around.
Python raises StopIteration when there are no more items to iterate (and
catches it to stop the iteration so normally you don't see it). If it's
being raised, though, you should be able to see the traceback to find
out from where.
If you are seeing only 'StopIteration:' is that in the terminal or in
the ui? If in the UI, you could set
`dabo.settings.eatBizExceptions=False` to hopefully see the traceback in
the terminal.
The current problem is the dabo2 branch is not working with
cursor.next(). When the code get to
next(self._CurrentCursor)
If there's no traceback what's your evidence this is happening from
dCursorMixin.next()?
I get the exception "StopIteration:" and I can't go forward with any
debugging (at least nothing I know about).
So will one of you please explain how it's suppose to work? Or maybe
you know what's wrong. I'll take a fix any day.
I think we'll need to rename it, unfortunately.
Paul
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]