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

Error at startup when using a Wacom Cintiq Pro 16 (DTH-1620) #15

Closed
jcpearson opened this issue Jul 31, 2018 · 1 comment
Closed

Error at startup when using a Wacom Cintiq Pro 16 (DTH-1620) #15

jcpearson opened this issue Jul 31, 2018 · 1 comment

Comments

@jcpearson
Copy link

wacom-gui fails to start when using Wacom Cintiq Pro 16 (DTH-1620) - error is:

  File "./wacom-gui.py", line 318, in <module>
    main()    
  File "./wacom-gui.py", line 233, in main
    window = WacomGui()
  File "./wacom-gui.py", line 25, in __init__
    self.initUI()
  File "./wacom-gui.py", line 29, in initUI
    self.pad           = Pad()
  File "/usr/local/wacom-gui/pad.py", line 22, in __init__
    self.initUI()
  File "/usr/local/wacom-gui/pad.py", line 62, in initUI
    self.Tablet.pop(idx - count)
IndexError: pop index out of range

I'm not really sure of the logic where this happens:

    # make sure we have at least 1 tablet detected...
    if gen_idx.__len__() < self.Tablet.__len__():
        gen_idx = sorted(gen_idx)
        count = 0 
        for idx in gen_idx:
            self.Tablet.pop(idx - count)

count is set to zero - but doesn't change - so (idx - count) is just (idx) ?

I can work around the error with the following patch:

--- ./wacom-gui/pad.py.dist     2018-06-18 16:26:00.000000000 +0100
+++ ./wacom-gui/pad.py  2018-07-30 12:11:35.666138338 +0100
@@ -56,7 +56,7 @@ class Pad(QtGui.QWidget):
                         gen_idx.append(idx)
                 # make sure we have at least 1 tablet detected...
                 if gen_idx.__len__() < self.Tablet.__len__():
-                    gen_idx = sorted(gen_idx)
+                    gen_idx = sorted(gen_idx, reverse=True)
                     count = 0
                     for idx in gen_idx:
                         self.Tablet.pop(idx - count)

But that might just be papering over the real issue?

IMHO the logic for selecting the 'first' tablet to use if there are more than one seems over complicated?

In this case, there is only one tablet connected, but it reports 4 separate USB ids - and only one is a 'known' tablet device

@tb2097
Copy link
Owner

tb2097 commented Nov 29, 2018

Closing this issue as it is related to the 0.2.x releases and I have no plans to further maintain it.

@tb2097 tb2097 closed this as completed Nov 29, 2018
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