Comment 0 for bug 941337

Revision history for this message
Ronny Lorenz (raumzeit) wrote :

It seems that once an inline function of a desklet is bound to a self-updating property of any Control it gets called continuously until eternity every time the control notifies about a change. Although this actually is the bahavior one wants and expects the function call continues even if the desklet is removed and thus the function is non-existent anymore. This in turn results in flooding the log with messages like these:

Warning: <function do_time at 0x3181230>(((10, 32, 57),)) has raised an exception
while running in main thread.
The error was:
'TargetCanvas' object has no attribute '_TargetCanvas__widget'
Traceback (most recent call last):
  File "/home/ronny/.local/lib/gdesklets/utils/__init__.py", line 181, in
run_in_main_thread
    return function(*args)
  File "<inline '/home/ronny/.gdesklets/Displays/clock-
desklet/clock.display_-4083978482491522790'>", line 70, in do_time
  File "/home/ronny/.local/lib/gdesklets/scripting/ElementWrapper.py", line 18, in
__setattr__
    self.__target(open).set_prop(name, value)
  File "/home/ronny/.local/lib/gdesklets/utils/Element.py", line 103, in set_prop
    setter(key, value)
  File "/home/ronny/.local/lib/gdesklets/display/TargetCanvas.py", line 232, in
_setp_graphics
    self.__render(value)
  File "/home/ronny/.local/lib/gdesklets/display/TargetCanvas.py", line 193, in
__render
    self.__redraw()
  File "/home/ronny/.local/lib/gdesklets/display/TargetCanvas.py", line 204, in
__redraw
    w, h = self.__widget.size_request()
AttributeError: 'TargetCanvas' object has no attribute '_TargetCanvas__widget'
==========================================================[02/26/12-11:32:58]===
Warning: <function do_time at 0x3181230>(((10, 32, 58),)) has raised an exception
while running in main thread.
The error was:
'TargetCanvas' object has no attribute '_TargetCanvas__widget'
Traceback (most recent call last):
  File "/home/ronny/.local/lib/gdesklets/utils/__init__.py", line 181, in
run_in_main_thread
    return function(*args)
  File "<inline '/home/ronny/.gdesklets/Displays/clock-
desklet/clock.display_-4083978482491522790'>", line 70, in do_time
  File "/home/ronny/.local/lib/gdesklets/scripting/ElementWrapper.py", line 18, in
__setattr__
    self.__target(open).set_prop(name, value)
  File "/home/ronny/.local/lib/gdesklets/utils/Element.py", line 103, in set_prop
    setter(key, value)
  File "/home/ronny/.local/lib/gdesklets/display/TargetCanvas.py", line 232, in
_setp_graphics
    self.__render(value)
  File "/home/ronny/.local/lib/gdesklets/display/TargetCanvas.py", line 193, in
__render
    self.__redraw()
  File "/home/ronny/.local/lib/gdesklets/display/TargetCanvas.py", line 204, in
__redraw
    w, h = self.__widget.size_request()
AttributeError: 'TargetCanvas' object has no attribute '_TargetCanvas__widget'

Shouldn't the binding of a specific inline-script variable to an update callback be broken on desklet removal?

The bug can be reproduced with at least version 0.36.3 up to the latest bazar revision (187) by adding e.g. Martin Grimme's clock-desklet and then removing it again. (other deklets that use the time property of ITime control produce the same results for me)