raghuram534 / autokey

Automatically exported from code.google.com/p/autokey
GNU General Public License v3.0
0 stars 0 forks source link

After random time (around 10 minues maybe less or more) autokey-qt stops to work #42

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I run 'autokey-qt' from command line, and when it stops to work (does not
respond on my key sequences), console contains following output:
$ autokey-qt
Exception in thread KeypressHandler-thread:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/site-packages/autokey/iomediator.py", line 182,
in run
    target.handle_hotkey(key, modifiers, windowName)
  File "/usr/lib/python2.5/site-packages/autokey/service.py", line 101, in
handle_hotkey
    hotkey.check_hotkey(modifiers, key, windowName)
  File "/usr/lib/python2.5/site-packages/autokey/configmanager.py", line
714, in check_hotkey
    self.closure()
AttributeError: GlobalHotkey instance has no attribute 'closure'

I am using Ubuntu 9.10 64bit linux, using Gnome, but I am using a lot kate
(kde) text editor. I have a feeling, that these crashes happens when I am
operating with kate.

Original issue reported on code.google.com by Madars.V...@gmail.com on 24 Apr 2010 at 8:18

GoogleCodeExporter commented 8 years ago
Version I am using is:

$ autokey-qt --version
Qt: 4.4.3
KDE: 4.1.4 (KDE 4.1.4)
AutoKey: 0.70.1

Original comment by Madars.V...@gmail.com on 24 Apr 2010 at 8:19

GoogleCodeExporter commented 8 years ago
Have you tried quitting AutoKey, then starting it again? That should work as a
workaround for now.

One liner fix, will be in v0.70.4

Original comment by cdekter on 24 Apr 2010 at 8:34

GoogleCodeExporter commented 8 years ago
Yes I restart it after that (with killall -9 autokey-qt and start it back 
again).
Time ago I created cron job to restart it after each 5 minutes!

Thank-you for fixing this, waiting for new version with eagerly ;)

Original comment by Madars.V...@gmail.com on 24 Apr 2010 at 9:05

GoogleCodeExporter commented 8 years ago
Try restarting it without killing it - quit it politely from the tray icon. Then
start it again and see if it keeps working. This will help me confirm that my 
fix
actually fixes the problem you're seeing.

Original comment by cdekter on 24 Apr 2010 at 9:07

GoogleCodeExporter commented 8 years ago
How do you mean start it again? That process is still kind of running. After 
that
stack trace what I added to issue description autokey-qt was not exiting and not
responding to ctrl+c so that is why I used -9.

So after that issue, process is running, but not responding on my key 
sequences. If I
start another autokey-qt, it says something like "already running with PID..."

Original comment by Madars.V...@gmail.com on 24 Apr 2010 at 9:14

GoogleCodeExporter commented 8 years ago
Hmm... OK, I will try from try icon to exit... lets see.

Original comment by Madars.V...@gmail.com on 24 Apr 2010 at 9:17

GoogleCodeExporter commented 8 years ago
Hmm I see... that does make sense. If you're keen, you can try modifying the 
source
yourself to see if it fixes the problem:

Edit /usr/share/pyshared/autokey/configmanager.py

At line 140 you can see:
        return ConfigManager(autoKeyApp)

remove that, and add:
        c = ConfigManager(autoKeyApp)
        autoKeyApp.init_global_hotkeys(c)
        return c

Original comment by cdekter on 24 Apr 2010 at 9:29

GoogleCodeExporter commented 8 years ago
OK thank-you, updated sources!
Lets see, will it crash or not anymore. Will give feedback (today or on Monday)
because of this randomness I cannot actually ensure when bug appears.

Original comment by Madars.V...@gmail.com on 24 Apr 2010 at 10:07

GoogleCodeExporter commented 8 years ago
Got the same issue today (with patched sources):

$ autokey-qt
Exception in thread KeypressHandler-thread:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/site-packages/autokey/iomediator.py", line 182, in run
    target.handle_hotkey(key, modifiers, windowName)
  File "/usr/lib/python2.5/site-packages/autokey/service.py", line 101, in handle_hotkey
    hotkey.check_hotkey(modifiers, key, windowName)
  File "/usr/lib/python2.5/site-packages/autokey/configmanager.py", line 715, in
check_hotkey
    self.closure()
AttributeError: GlobalHotkey instance has no attribute 'closure'

And so I closed from try icon, and started program from console again. After 
starting
it back, program continues to work.

In that stack-trace I see that configmanager.py file is the same:
$ cksum /usr/share/pyshared/autokey/configmanager.py
4166718965 26893 /usr/share/pyshared/autokey/configmanager.py
$ cksum /usr/lib/python2.5/site-packages/autokey/configmanager.py
4166718965 26893 /usr/lib/python2.5/site-packages/autokey/configmanager.py

That part of source I am using is:
--------------
        _logger.info("Successfully loaded configuration file")
        _logger.debug("Global settings: %r", ConfigManager.SETTINGS)
        return configManager
    else:
        _logger.info("No configuration file found - creating new one")
        _logger.debug("Global settings: %r", ConfigManager.SETTINGS)
        c = ConfigManager(autoKeyApp)
        autoKeyApp.init_global_hotkeys(c)
        return c

def save_config(configManager):
    _logger.info("Persisting configuration")
    # Back up configuration if it ex
-----------------------

Original comment by Madars.V...@gmail.com on 24 Apr 2010 at 2:09

GoogleCodeExporter commented 8 years ago
Thanks for testing - the change I sent you fixes another bug but not the one 
you're
having :P

I have another fix for you to test:

In /usr/share/pyshared/autokey/qtapp.py

At line 157, below:
configManager.configHotkey.set_closure(self.show_configure_async)

add the following:
configManager.showPopupHotkey.set_closure(lambda: False)

Original comment by cdekter on 24 Apr 2010 at 2:19

GoogleCodeExporter commented 8 years ago
Added that line ;) Will continue my testing. Thanks!

Original comment by Madars.V...@gmail.com on 24 Apr 2010 at 2:24

GoogleCodeExporter commented 8 years ago
After your last suggested change:
-------------
In /usr/share/pyshared/autokey/qtapp.py

At line 157, below:
configManager.configHotkey.set_closure(self.show_configure_async)

add the following:
configManager.showPopupHotkey.set_closure(lambda: False)

-------------

I have not noticed crashes anymore. So that is the fix for this issue!

Thanks a lot!

Original comment by Madars.V...@gmail.com on 26 Apr 2010 at 11:04