Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aw-watcher-window error #59

Closed
theguybieber opened this issue Jun 2, 2017 · 3 comments
Closed

aw-watcher-window error #59

theguybieber opened this issue Jun 2, 2017 · 3 comments

Comments

@theguybieber
Copy link

aw-watcher-window gets a list index out of range error while trying to get the active window. Here is the stack trace:

Guys-MacBook-Pro:activitywatch guybieber$ source ./venv/bin/activate
(venv) Guys-MacBook-Pro:activitywatch guybieber$ aw-watcher-window
osascript: /Users/guybieber/Documents/guy/2016Karmas/Development/source/activitywatch/venv/lib/python3.6/site-packages/aw_watcher_window-0.1-py3.6.egg/aw_watcher_window/printAppTitle.scpt: No such file or directory
2017-06-01 18:20:09,324 [ERROR]: Exception thrown while trying to get active window: list index out of range (main.py:59)
Traceback (most recent call last):
File "/Users/guybieber/Documents/guy/2016Karmas/Development/source/activitywatch/venv/lib/python3.6/site-packages/aw_watcher_window-0.1-py3.6.egg/aw_watcher_window/main.py", line 56, in main
current_window = get_current_window()
File "/Users/guybieber/Documents/guy/2016Karmas/Development/source/activitywatch/venv/lib/python3.6/site-packages/aw_watcher_window-0.1-py3.6.egg/aw_watcher_window/lib.py", line 49, in get_current_window
return get_current_window_macos()
File "/Users/guybieber/Documents/guy/2016Karmas/Development/source/activitywatch/venv/lib/python3.6/site-packages/aw_watcher_window-0.1-py3.6.egg/aw_watcher_window/lib.py", line 29, in get_current_window_macos
title = macos.getTitle(info)
File "/Users/guybieber/Documents/guy/2016Karmas/Development/source/activitywatch/venv/lib/python3.6/site-packages/aw_watcher_window-0.1-py3.6.egg/aw_watcher_window/macos.py", line 17, in getTitle
return info.split('","')[1][:-1]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/guybieber/Documents/guy/2016Karmas/Development/source/activitywatch/venv/bin/aw-watcher-window", line 11, in
load_entry_point('aw-watcher-window==0.1', 'console_scripts', 'aw-watcher-window')()
File "/Users/guybieber/Documents/guy/2016Karmas/Development/source/activitywatch/venv/lib/python3.6/site-packages/aw_watcher_window-0.1-py3.6.egg/aw_watcher_window/main.py", line 60, in main
traceback.print_exc(e)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 159, in print_exc
print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 100, in print_exception
type(value), value, tb, limit=limit).format(chain=chain):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 497, in init
capture_locals=capture_locals)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 332, in extract
if limit >= 0:
TypeError: '>=' not supported between instances of 'IndexError' and 'int'

@ErikBjare
Copy link
Member

I think I know what is causing this. A fix will be out later today.

Thanks for filing this issue! :)

@ErikBjare
Copy link
Member

Fixed now, the culprit was actually in:

osascript: /Users/guybieber/Documents/guy/2016Karmas/Development/source/activitywatch/venv/lib/python3.6/site-packages/aw_watcher_window-0.1-py3.6.egg/aw_watcher_window/printAppTitle.scpt: No such file or directory

The AppleScript we use to get window title was not included in the package. This was fixed in ActivityWatch/aw-watcher-window@85e6fff and merged into the bundle repo at 30a82da.

Please let us know how this works for you. And again, thanks for filing the issue! 👍

@theguybieber
Copy link
Author

Awesome job turning around the fix. I will try it today.

@ErikBjare ErikBjare added this to the v0.7 milestone Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants