can't reopen hamster applet after closing it: 'NoneType' object has no attribute 'show' in main
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Project Hamster |
Fix Released
|
Medium
|
|||
hamster-applet (Ubuntu) |
Fix Released
|
Low
|
Jamie Strandboge | ||
Precise |
Fix Released
|
Low
|
Jamie Strandboge |
Bug Description
This seems like a new regression in Precise:
I can start Hamster from the Launcher, and use it normally. If I close the main window eg by pressing Escape, it closes, and the icon is inactive (loses the little arrow) in my Launcher. If I click it again, it does not start, I get an apport window, and I see this traceback in .xsession-errors:
Traceback (most recent call last):
File "/usr/bin/
getattr(server, window)()
File "/usr/lib/
return self._proxy_
File "/usr/lib/
**keywords)
File "/usr/lib/
message, timeout)
dbus.exceptions
File "/usr/lib/
retval = candidate_
File "/usr/bin/
self.
AttributeError: 'NoneType' object has no attribute 'show'
I can see there are still hamster processes running:
6815 ? Sl 0:04 python /usr/bin/
6821 ? S 0:00 /usr/bin/python /usr/bin/
I think this bug is something to do with connecting to them, or restarting them.
If I kill them manually then I can start Hamster again.
Changed in hamster-applet (Ubuntu): | |
status: | New → Confirmed |
Changed in hamster-applet (Ubuntu): | |
status: | Confirmed → In Progress |
assignee: | nobody → Jamie Strandboge (jdstrand) |
Changed in hamster-applet: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in hamster-applet: | |
status: | New → Fix Released |
I thing what may be going on is when the window is being destroyed:
self.save_ window_ position( )
self.window. destroy( )
self.show_ in_tray( )
def close_window(self, *args):
self.window = None
def on_delete_ window( self, event, data):
self.save_ window_ position( )
self.window. destroy( )
self.show_ in_tray( )
self.window = None
The app object is not destroyed. So then on re-entrancy: service. method( "org.gnome. Hamster. WindowServer" )
self. app.window. show()
self. app.window. present( )
self. app = ProjectHamster()
@dbus.
def main(self):
if self.app:
else:
since there is an application object, it assumes there is a window object. I suspect the right fix is to test if the self.app.window is not None, and recreate the window if necessary. It may also be simply to hide self.window instead of destroy it.