{"action":"created","issue":{"url":"https://api.github.com/repos/tb2097/wacom-gui/issues/11","repository_url":"https://api.github.com/repos/tb2097/wacom-gui","labels_url":"https://api.github.com/repos/tb2097/wacom-gui/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/tb2097/wacom-gui/issues/11/comments","events_url":"https://api.github.com/repos/tb2097/wacom-gui/issues/11/events","html_url":"https://github.com/tb2097/wacom-gui/issues/11","id":329399867,"node_id":"MDU6SXNzdWUzMjkzOTk4Njc=","number":11,"title":"Crash when using tablets that have different device names","user":{"login":"jcpearson","id":5602231,"node_id":"MDQ6VXNlcjU2MDIyMzE=","avatar_url":"https://avatars0.githubusercontent.com/u/5602231?v=4","gravatar_id":"","url":"https://api.github.com/users/jcpearson","html_url":"https://github.com/jcpearson","followers_url":"https://api.github.com/users/jcpearson/followers","following_url":"https://api.github.com/users/jcpearson/following{/other_user}","gists_url":"https://api.github.com/users/jcpearson/gists{/gist_id}","starred_url":"https://api.github.com/users/jcpearson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcpearson/subscriptions","organizations_url":"https://api.github.com/users/jcpearson/orgs","repos_url":"https://api.github.com/users/jcpearson/repos","events_url":"https://api.github.com/users/jcpearson/events{/privacy}","received_events_url":"https://api.github.com/users/jcpearson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-05T10:43:07Z","updated_at":"2018-06-05T18:23:11Z","closed_at":"2018-06-05T18:23:11Z","author_association":"NONE","body":"When using a Intuos Pro M (PTH-651), wacom-gui crashes with:\r\n\r\n```\r\nCannot find device 'Wacom Intuos Pro M Finger  touch'.\r\nTraceback (most recent call last):\r\n  File \"/usr/local/wacom-gui/wacom-gui.py\", line 305, in <module>\r\n    main()    \r\n  File \"/usr/local/wacom-gui/wacom-gui.py\", line 218, in main\r\n    window = WacomGui()\r\n  File \"/usr/local/wacom-gui/wacom-gui.py\", line 25, in __init__\r\n    self.initUI()\r\n  File \"/usr/local/wacom-gui/wacom-gui.py\", line 33, in initUI\r\n    self.touch = touch(self.pad.Tablet.deviceNames['touch'])\r\n  File \"/usr/local/wacom-gui/touch.py\", line 16, in __init__\r\n    self.initUI()\r\n  File \"/usr/local/wacom-gui/touch.py\", line 27, in initUI\r\n    self.getEnableStatus()\r\n  File \"/usr/local/wacom-gui/touch.py\", line 47, in getEnableStatus\r\n    if getCommand[0] == \"on\\n\":\r\nIndexError: list index out of range\r\n```\r\n\r\nNot sure why touch.py is re-assigning 'tabletName' - as it already has it set correctly ???\r\n\r\nThe following patch tidies this all up - plus removes a later unnecessary check :\r\n\r\n```\r\n--- ./wacom-gui/touch.py.dist   2018-05-28 17:13:39.000000000 +0100\r\n+++ ./wacom-gui/touch.py        2018-06-05 10:54:55.279117673 +0100\r\n@@ -6,20 +6,14 @@ import sys, os, re\r\n class touch(QtGui.QWidget):\r\n     def __init__(self, tabletName, parent=None):\r\n         QtGui.QWidget.__init__(self, parent)\r\n-        devices = os.popen(\"xsetwacom --list devices\").readlines()\r\n-        self.tabletName = None\r\n-        for device in devices:\r\n-            attr = device.strip().split('\\t')\r\n-            if attr[2] == 'type: TOUCH':\r\n-                self.tabletName = attr[0][:-6]\r\n-                self.enable = None\r\n+        if tabletName ==  \"\":\r\n+            return None\r\n+        self.tabletName = tabletName\r\n+        self.enable = None\r\n         self.initUI()\r\n \r\n     def initUI(self):\r\n         self.devices = []\r\n-        # check if it is even necessary\r\n-        if os.popen(\"xsetwacom --list devices | grep touch\").readlines().__len__() == 0:\r\n-            return None\r\n         # layout code\r\n         self.mainLayout = QtGui.QHBoxLayout()\r\n         self.mainLayout.setAlignment(QtCore.Qt.AlignLeft)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/tb2097/wacom-gui/issues/comments/394811380","html_url":"https://github.com/tb2097/wacom-gui/issues/11#issuecomment-394811380","issue_url":"https://api.github.com/repos/tb2097/wacom-gui/issues/11","id":394811380,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDgxMTM4MA==","user":{"login":"tb2097","id":6462303,"node_id":"MDQ6VXNlcjY0NjIzMDM=","avatar_url":"https://avatars0.githubusercontent.com/u/6462303?v=4","gravatar_id":"","url":"https://api.github.com/users/tb2097","html_url":"https://github.com/tb2097","followers_url":"https://api.github.com/users/tb2097/followers","following_url":"https://api.github.com/users/tb2097/following{/other_user}","gists_url":"https://api.github.com/users/tb2097/gists{/gist_id}","starred_url":"https://api.github.com/users/tb2097/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tb2097/subscriptions","organizations_url":"https://api.github.com/users/tb2097/orgs","repos_url":"https://api.github.com/users/tb2097/repos","events_url":"https://api.github.com/users/tb2097/events{/privacy}","received_events_url":"https://api.github.com/users/tb2097/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T18:23:11Z","updated_at":"2018-06-05T18:23:11Z","author_association":"OWNER","body":"I had seen this issue with another user but only had a PTH-650 to test with, which didn't show the same error.\r\nThe issue is the tablet name was having an extra space at the end so the constructed string was invalid.  Whitespace is now stripped from the end of device names to ensure correct naming, as well as having the device list default to _None_ value for more correct check.  V0.2.1-3 will be released soon.\r\n```\r\n'Wacom Intuos Pro M Finger  touch'\r\n'Wacom Intuos Pro M Finger touch'\r\n```"}}
{"actor":{"display_login":"tb2097"}}