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

Python exception in usage_pages.py when an unknown usage is encountered. #12

Closed
chriswm opened this issue Mar 2, 2014 · 1 comment
Closed

Comments

@chriswm
Copy link

chriswm commented Mar 2, 2014

The wrong variable appears to have been used in the repr() function. The following patch fixes this.

--- pywinusb/pywinusb-0.3.2/pywinusb/hid/usage_pages.py Sun Mar 02 14:32:49 2014
+++ pywinusb/pywinusb-0.3.2_fixed_usages/pywinusb/hid/usage_pages.py    Mon Feb 17 20:40:31 2014
@@ -1075,11 +1075,11 @@
             page = self.Usages[self.page_id]
             if self.usage_id in page:
                 return "%s device, %s usage" % (str(UsagePage(self.page_id)), 
                         page[self.usage_id][0])
             else:
-                return "%s device, Unknown usage" % str(UsagePage(page))
+                return "%s device, Unknown usage" % str(UsagePage(self.page_id))
         return "Unknown Page/usage"

 if __name__ == '__main__':
     #simple testing
     PAGES = [

Once that was fixed this module worked perfectly for me. Thank you!

Chris

@rene-aguirre
Copy link
Owner

Thanks Chris!

The patch is applied already.

Best regards

Rene

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants