Skip to content

ButtonEVIO references _file_cache #167

Closed

Description

@dwalton76

File "./rubiks.py", line 47, in init
self.buttons = Button()
File "build/bdist.linux-armv5tejl/egg/ev3dev/core.py", line 2118, in init
File "build/bdist.linux-armv5tejl/egg/ev3dev/core.py", line 2122, in _button_file

Activity

  1. dwalton76 commented on May 21, 2016

    @dwalton76
    CollaboratorAuthor

    @rhempel if you can point me in the right direction on how this should work I can look at this one

  2. rhempel commented on May 22, 2016

    @rhempel
    Member

    Is this using the latest (untagged) version of the binding in the develop branch?

  3. dwalton76 commented on May 22, 2016

    @dwalton76
    CollaboratorAuthor

    yes

  4. rhempel commented on May 22, 2016

    @rhempel
    Member

    OK, I'll look at adding a Button() unit test set (I need to do this anyways, and figure out what's going on. I think that somewhere around 2118 and 2112 is where to start looking :-)

    Most likely the issue is the way the Button instance is instatiated - and as I recall that part of the binding is hand-generated.

  5. ddemidov commented on May 22, 2016

    @ddemidov
    Member

    Looks like the problem was introduced in #162. The Button class is derived from Device and uses _file_cache which was removed in #162.

  6. rhempel commented on May 22, 2016

    @rhempel
    Member

    Hmmm, I thought I had removed all the uses of _file_cache - either I did not or I clobbered a merge somewhere. Either way, a test suite for Buttons() is next in line to get done, and then fixing the code should allow the tests to pass,

  7. rhempel commented on May 25, 2016

    @rhempel
    Member

    Unit test case created and failing (good) - code fix should arrive tomorrow ... I certainly removed the first instance of the _file_cache but did not complete the task

  8. rhempel commented on May 27, 2016

    @rhempel
    Member

    I finally got this done - the current https://github.com/rhempel/ev3dev-lang-python/tree/develop branch has the most up to date code - feel free to test and provide feedback

  9. Kurtoid commented on Jun 7, 2016

    @Kurtoid

    Newbie here: how can I apply the fix to my brick?

  10. rhempel commented on Jun 7, 2016

    @rhempel
    Member

    Thanks for checking to see if this is an existing issue :-) If you are comfortable with the command line and you are using Python2, you can replace the file at /usr/lib/python2.7/dist-packages/ev3dev/ev3.py with the one from the current https://github.com/rhempel/ev3dev-lang-python/tree/develop branch. If you're using Python3 - it's more complicated and you have to fix a .egg file.

    I am working on fixing a few things in the Python API (still) and plan to release something soon (can't be more specific than that - sorry)

  11. Kurtoid commented on Jun 8, 2016

    @Kurtoid

    If egg files are a zip file, can i just unzip it, change the code and zip it again? (python3)
    Thanks

  12. rhempel commented on Jun 8, 2016

    @rhempel
    Member

    I think so - or you can do what I did which is rename the egg file to some other extension and link the Python 3 library folder to the Python 2 library

    But I was not sure how comfortable you were doing any of this :-)

  13. Kurtoid commented on Jun 8, 2016

    @Kurtoid

    Thanks! I deleted the python 3 egg file, and copied the python 2 version to 3, and then patched the file.

  14. dwalton76 commented on Jun 8, 2016

    @dwalton76
    CollaboratorAuthor

    sudo python setup.py install

    Is worth a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions