[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-bugs] <bug>: and here is the error again, this time with
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-bugs] <bug>: and here is the error again, this time with |
Date: |
Sun, 20 Jan 2013 17:15:55 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
> user comment : and here is the error again, this time with more info appended
Excellent, thanks.
Now, this:
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #831): populating provider inbox
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #834): total # of inbox msgs for current provider: 95
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #846): inbox set to show all messages
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #848): # of inbox msgs to actually show: 95
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #859): # of list items created from msgs: 95
proves that the provider inbox code itself isn't at fault as
it retrieves the messages just fine and also calculates the
correct number of items.
There's a few observations:
1) When the problem occurs, there seem to be twice as many
list items as there are data items:
> 2013-01-19 23:04:36 DEBUG gm.gui
> (/usr/share/gnumed/Gnumed/wxpython/gmExceptionHandlingWidgets.py::handle_uncaught_exception_wx()
> #165): unhandled exception caught:
...
> File "/usr/share/gnumed/Gnumed/wxpython/gmListWidgets.py", line 988, in
> set_data
> raise ValueError('<data> length (%s) must be equal to number of list
> items (%s)' % (len(data), self.ItemCount))
> ValueError: <data> length (95) must be equal to number of list items (190)
seaming to mean that for some reason list items (as opposed
to data) get set twice without a deletion of items
inbetween. Which, however, should not happen because we only
ever set provider inbox list items with this function:
#------------------------------------------------------------
def set_string_items(self, items = None):
"""All item members must be unicode()able or None."""
self.DeleteAllItems()
if self.ItemCount != 0:
raise ValueError('.ItemCount not 0 after
.DeleteAllItems()')
...
which deletes existing items before adding new ones. Which
could lead one to suspect there's something wrong with
deleting the items which is why here I have introduced yet
another check which I will send you for testing. This is
fairly unlikely, however, as it would mean a bug in wxPython
itself.
2) Another thing is that when populating the inbox works
items only get set once:
> 2013-01-19 23:03:24 DEBUG gm.main
> (/usr/share/gnumed/Gnumed/wxpython/gmGuiMain.py::__register_events() #3056):
> connected signal monitor
> 2013-01-19 23:03:24 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #831): populating provider inbox
> 2013-01-19 23:03:24 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #834): total # of inbox msgs for current provider: 98
> 2013-01-19 23:03:24 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #846): inbox set to show all messages
> 2013-01-19 23:03:24 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #848): # of inbox msgs to actually show: 98
> 2013-01-19 23:03:24 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #859): # of list items created from msgs: 98
> 2013-01-19 23:03:24 DEBUG gm.emr
> (/usr/share/gnumed/Gnumed/business/gmClinicalRecord.py::set_func_ask_user()
> #70): setting _func_ask_user to [<function ask_for_encounter_continuation at
> 0x2477c80>]
> 2013-01-19 23:03:26 DEBUG gm.person
> (/usr/share/gnumed/Gnumed/business/gmPerson.py::__init__() #1320): patient
> change [cNull instance] -> [870] requested
or
> 2013-01-19 23:03:39 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmHorstSpace.py::_on_notebook_page_changed()
> #206): just after switching notebook tabs
> 2013-01-19 23:03:39 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmHorstSpace.py::_on_notebook_page_changed()
> #212): event.GetOldSelection()=8 -> event.GetSelection()=0*
> 2013-01-19 23:03:39 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #831): populating provider inbox
> 2013-01-19 23:03:39 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #834): total # of inbox msgs for current provider: 97
> 2013-01-19 23:03:39 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #846): inbox set to show all messages
> 2013-01-19 23:03:39 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #848): # of inbox msgs to actually show: 97
> 2013-01-19 23:03:39 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #859): # of list items created from msgs: 97
> 2013-01-19 23:03:41 DEBUG gm.person
> (/usr/share/gnumed/Gnumed/business/gmPerson.py::__init__() #1320): patient
> change [870] -> [936] requested
while it seems to get set twice when it fails:
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmHorstSpace.py::_on_notebook_page_changed()
> #212): event.GetOldSelection()=8 -> event.GetSelection()=0*
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #831): populating provider inbox
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #834): total # of inbox msgs for current provider: 95
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #846): inbox set to show all messages
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #848): # of inbox msgs to actually show: 95
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #859): # of list items created from msgs: 95
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #831): populating provider inbox
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #834): total # of inbox msgs for current provider: 95
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #846): inbox set to show all messages
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #848): # of inbox msgs to actually show: 95
> 2013-01-19 23:04:36 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py::__populate_inbox()
> #859): # of list items created from msgs: 95
> 2013-01-19 23:04:36 DEBUG gm.gui
> (/usr/share/gnumed/Gnumed/wxpython/gmExceptionHandlingWidgets.py::handle_uncaught_exception_wx()
> #165): unhandled exception caught:
> Traceback (most recent call last):
> File "/usr/share/gnumed/Gnumed/wxpython/gmHorstSpace.py", line 223, in
> _on_notebook_page_changed
> new_page.receive_focus()
> File "/usr/share/gnumed/Gnumed/wxpython/gmPlugin.py", line 188, in
> receive_focus
> self._widget.repopulate_ui()
> File "/usr/share/gnumed/Gnumed/wxpython/gmRegetMixin.py", line 142, in
> repopulate_ui
> self.__repopulate_ui()
> File "/usr/share/gnumed/Gnumed/wxpython/gmRegetMixin.py", line 80, in
> __repopulate_ui
> repopulated = self._populate_with_data()
> File "/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py", line
> 797, in _populate_with_data
> self.__populate_inbox()
> File "/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py", line
> 861, in __populate_inbox
> self._LCTRL_provider_inbox.set_data(data = self.__msgs)
> File "/usr/share/gnumed/Gnumed/wxpython/gmListWidgets.py", line 988, in
> set_data
> raise ValueError('<data> length (%s) must be equal to number of list
> items (%s)' % (len(data), self.ItemCount))
> ValueError: <data> length (95) must be equal to number of list items (190)
> 2013-01-19 23:04:36 DEBUG gm.cfg
> (/usr/share/gnumed/Gnumed/pycommon/gmCfg2.py::get() #314): option
> [internal::debug] found in source [internal]
which prompts me to add yet more logging which will tell us
*why* the inbox was repopulated (and thus, why twice) ...
Attached find two new files to replace into your
/usr/share/gnumed/Gnumed/wxpython/gmListWidgets.py
/usr/share/gnumed/Gnumed/wxpython/gmProviderInboxWidgets.py
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
gmListWidgets.py
Description: Text Data
gmProviderInboxWidgets.py
Description: Text Data