Coder Social home page Coder Social logo

Comments (4)

alexklaeser avatar alexklaeser commented on August 22, 2024

It seems to be an issue with MonomeGridEvent inheriting from MonomeEvent (which only expects 1 constructor parameter). As soon as I remove the inheritance of MonomeEvent, it works.

from libmonome.

alexklaeser avatar alexklaeser commented on August 22, 2024

The following patch works for me:

diff --git a/bindings/python/monome.pyx b/bindings/python/monome.pyx
index af750ec..bdee2e4 100644
--- a/bindings/python/monome.pyx
+++ b/bindings/python/monome.pyx
@@ -115,6 +115,8 @@ all = [

        "Monome"]

+BUTTON_UP, BUTTON_DOWN, ENCODER_DELTA, ENCODER_KEY_UP, ENCODER_KEY_DOWN, TILT = range(6)
+CABLE_LEFT, CABLE_BOTTOM, CABLE_RIGHT, CABLE_TOP = range(4)

 MODE_NORMAL = 0
 MODE_TEST = 1
@@ -155,15 +157,12 @@ def _bitmap_data(data):
 cdef class MonomeEvent(object):
        cdef object monome

-       def __cinit__(self, object monome):
-               self.monome = monome
-
 cdef class MonomeGridEvent(MonomeEvent):
        cdef uint x, y
        cdef bool pressed

        def __cinit__(self, pressed, uint x, uint y, object monome):
-               MonomeEvent.__cinit__(monome)
+               self.monome = monome
                self.pressed = bool(pressed)
                self.x = x
                self.y = y

from libmonome.

wrl avatar wrl commented on August 22, 2024

yeah i'm cool with this. it would be nice to handle all common stuff in MonomeEvent but Cython sometimes doesn't want to play nice.

could you submit this as a pull request?

from libmonome.

alexklaeser avatar alexklaeser commented on August 22, 2024

Cool. I submitted a pull request...
best regards
Alex

from libmonome.

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.