Git Product home page Git Product logo

Comments (11)

ErikBjare avatar ErikBjare commented on June 15, 2024 1

@dbieber You're just lucky, I was just about to stop working for the day 😉

from aw-watcher-input.

dbieber avatar dbieber commented on June 15, 2024 1

Installing in a fresh virtualenv resolved the issue,

now it starts but with these errors:

> aw-watcher-input 
INFO:aw_watcher_input.main:Starting watcher...
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/Users/dbieber/.virtualenvs/aw-watcher-input/lib/python3.7/site-packages/pymouse/mac.py", line 113, in run
    loopsource = Quartz.CFMachPortCreateRunLoopSource(None, tap, 0)
  File "/Users/dbieber/.virtualenvs/aw-watcher-input/lib/python3.7/site-packages/objc/_lazyimport.py", line 207, in __getattr__
    raise AttributeError(name)
AttributeError: CFMachPortCreateRunLoopSource

INFO:aw_watcher_input.main:No new input
INFO:aw_watcher_input.main:No new input
INFO:aw_watcher_input.main:No new input
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/Users/dbieber/.virtualenvs/aw-watcher-input/lib/python3.7/site-packages/pykeyboard/mac.py", line 221, in run
    Quartz.CFRunLoopRunInMode(Quartz.kCFRunLoopDefaultMode, 5, False)
  File "/Users/dbieber/.virtualenvs/aw-watcher-input/lib/python3.7/site-packages/pykeyboard/mac.py", line 258, in handler
    self.key_press(key)
AttributeError: 'KeyboardListener' object has no attribute 'key_press'
INFO:aw_watcher_input.main:No new input
INFO:aw_watcher_input.main:No new input
INFO:aw_watcher_input.main:No new input
INFO:aw_watcher_input.main:No new input

From the "working" virtualenv, here's the output of the requested command:

> pip freeze | grep pyobjc
pyobjc-core @ file:///Users/dbieber/Library/Caches/pypoetry/artifacts/b2/19/4f/005efdc28d19ef087a5e3b3785852305ba8d5d46460f72b9b271c65031/pyobjc_core-7.0.1-cp37-cp37m-macosx_10_9_x86_64.whl
pyobjc-framework-Cocoa @ file:///Users/dbieber/Library/Caches/pypoetry/artifacts/e3/5b/6b/dd2dd93f4f528accbd314034720928c813b88865856ada4833032ba147/pyobjc_framework_Cocoa-7.0.1-cp37-cp37m-macosx_10_9_x86_64.whl
pyobjc-framework-Quartz @ file:///Users/dbieber/Library/Caches/pypoetry/artifacts/75/a2/a2/96a923d37185a4a47deec56474de67a9edefcc98673e5d12467d40d038/pyobjc_framework_Quartz-7.0.1-cp37-cp37m-macosx_10_9_x86_64.whl

And yes I did poetry install again.

from aw-watcher-input.

ErikBjare avatar ErikBjare commented on June 15, 2024 1

@dbieber I've opened an issue in the PyUserInput repo PyUserInput/PyUserInput#61. It looks like an easy fix, but I might be wrong about that.

If you have the time, feel free to give it a shot. Otherwise, I might look into it myself in a few weeks.

from aw-watcher-input.

ErikBjare avatar ErikBjare commented on June 15, 2024

This issue seems to originate in aw-watcher-afk (which depends on pyobjc). It's been breaking the CI for aw-watcher-afk for some time now, hopefully all that's needed is to update pyobjc.

If this CI run passes, then I've fixed it, and I'll update aw-watcher-input in just a moment :)

from aw-watcher-input.

ErikBjare avatar ErikBjare commented on June 15, 2024

aw-watcher-afk CI run passed! Fixed for aw-watcher-input in a6730e2

Thanks for reporting 🙂

from aw-watcher-input.

dbieber avatar dbieber commented on June 15, 2024

Thanks for your impressively prompt turn around fixing this! 🙏

from aw-watcher-input.

dbieber avatar dbieber commented on June 15, 2024

Hmm, even after updating to a6730e2 I still get the same error.

> pip freeze | grep aw
aw-client @ file:///Users/dbieber/.virtualenvs/aw/src/aw-client
aw-core @ file:///Users/dbieber/.virtualenvs/aw/src/aw-core
aw-qt==0.1.0
aw-server==0.9
aw-watcher-afk @ file:///Users/dbieber/.virtualenvs/aw/src/aw-watcher-afk
aw-watcher-input==0.1.0
aw-watcher-window==0.2.0
timeslot @ file:///Users/dbieber/.virtualenvs/aw/src/timeslot

from aw-watcher-input.

ErikBjare avatar ErikBjare commented on June 15, 2024

@dbieber Can you give me pip freeze | grep pyobjc? Did you run poetry install again?

If you have the latest pyobjc, it should work (otherwise I'm clueless).

from aw-watcher-input.

ErikBjare avatar ErikBjare commented on June 15, 2024

Huh, that's new. Might be caused by the v21 API/bumping pyobjc to 7.0. It presumably affects aw-watcher-afk as well.

Edit: It does not affect aw-watcher-afk since it's been upgraded to use CGEventSourceSecondsSinceLastEventType: https://github.com/ActivityWatch/aw-watcher-afk/blob/master/aw_watcher_afk/macos.py

from aw-watcher-input.

dbieber avatar dbieber commented on June 15, 2024

Thanks for looking into it. I’ll let you know if I get a chance to look into it myself before then.

from aw-watcher-input.

dbieber avatar dbieber commented on June 15, 2024

I logged my progress in PyUserInput/PyUserInput#61.
Switching to Python 3.9 (not sure if necessary) and rolling jedi back to version 0.17.2 partially resolved the issue; now its successfully logging mouse moves. No changes were needed to aw-watcher-input or PyUserInput for this.

Still gives the CFMachPortCreateRunLoopSource AttributeError.

> aw-watcher-input 
INFO:aw_watcher_input.main:Starting watcher...
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/Users/dbieber/.virtualenvs/aw-watcher-input/lib/python3.9/site-packages/pykeyboard/mac.py", line 215, in run
    loopsource = Quartz.CFMachPortCreateRunLoopSource(None, tap, 0)
  File "/Users/dbieber/.virtualenvs/aw-watcher-input/lib/python3.9/site-packages/objc/_lazyimport.py", line 207, in __getattr__
    raise AttributeError(name)
AttributeError: CFMachPortCreateRunLoopSource
INFO:aw_watcher_input.main:No new input
INFO:aw_watcher_input.main:New input: {'id': None, 'timestamp': datetime.datetime(2020, 12, 30, 17, 59, 12, 131000, tzinfo=datetime.timezone.utc), 'duration': datetime.timedelta(seconds=1, microseconds=13449), 'data': {'presses': 0, 'clicks': 0, 'deltaX': 10.9921875, 'deltaY': 53.1328125}}
INFO:aw_watcher_input.main:New input: {'id': None, 'timestamp': datetime.datetime(2020, 12, 30, 17, 59, 13, 144000, tzinfo=datetime.timezone.utc), 'duration': datetime.timedelta(seconds=1, microseconds=6188), 'data': {'presses': 0, 'clicks': 0, 'deltaX': 165.3203125, 'deltaY': 204.9375}}

The logging of mouse data seems intermittent, and isn't showing up again on subsequent runs.

from aw-watcher-input.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.