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

AttributeError: 'NoneType' object has no attribute 'replace' #13

Closed
amsaid1989 opened this issue Jun 14, 2018 · 8 comments
Closed

AttributeError: 'NoneType' object has no attribute 'replace' #13

amsaid1989 opened this issue Jun 14, 2018 · 8 comments

Comments

@amsaid1989
Copy link

amsaid1989 commented Jun 14, 2018

I have just found out about this amazing tool, having used it on my school's computer. I installed it on my home workstation, but every time I run it, I get the following traceback from Python:

QPainter::begin: Paint device returned engine == 0, type: 2 QPainter::font: Painter not active QPainter::setFont: Painter not active QPainter::setPen: Painter not active QPainter::end: Painter not active, aborted Traceback (most recent call last): File "/usr/local/wacom-gui/wacom-gui.py", line 299, in <module> main() File "/usr/local/wacom-gui/wacom-gui.py", line 218, in main window = WacomGui() File "/usr/local/wacom-gui/wacom-gui.py", line 25, in __init__ self.initUI() File "/usr/local/wacom-gui/wacom-gui.py", line 32, in initUI self.cursorControl = pressure(self.pad.Tablet.deviceNames['cursor'], 'cursor') File "/usr/local/wacom-gui/pressure.py", line 312, in __init__ self.tabletName = name.replace('Pad', 'Pen') AttributeError: 'NoneType' object has no attribute 'replace'

This happens whether I am running it from the actual source files, or via the installed rpm.

I tried figuring out the problem on my own, since I know a little bit of Python, but without any luck. Any idea, what might be causing this issue.

I am sure it has nothing to do with the tablet itself, as I have tried it with two different ones (both should be supported) and, in both cases, I got the same outcome.

The models I used are:

  1. Bamboo Pen & Touch 4x5 (CTH-460K)
  2. Cintiq 13hd (DTK-1300)
@tb2097
Copy link
Owner

tb2097 commented Jun 14, 2018

So... this is a bit of legacy code I seem to have missed cleaning up, but for some reason is only causing issues on your home machine.
For a quick hack, comment out these lines in wacom-gui.py:
32, 78, 96, 107

I don't have access to my test wacom tonight but that'll fix it. Effectively the error that is occurring is no wacom cursor device is being found (default set to None in pad.py on line 72), which fails to rename the device name for proper use further down the line. I don't believe there is anything configurable for the cursor (legacy wacom mouse) so I'll likely remove that code and release a new version.

@amsaid1989
Copy link
Author

Thanks for the quick reply. It might not be causing an issue in the school machine because we have a dedicated IT department, so someone might have noticed the issue and fixed it. Not sure if that is what happened or not, but it could be.

As for your suggested fix, it does the job. The GUI now loads properly and it works.

@tb2097 tb2097 reopened this Jun 14, 2018
@tb2097
Copy link
Owner

tb2097 commented Jun 14, 2018

Updated to take into account a cursor isn't detected. Can you please try the new release and let me know if it fixes the issue?
I am also curious what school is using the GUI, if you don't mind letting me know. As well, if your IT department has made any changes please encourage them to contact me so I can possibly integrate their changes.

@amsaid1989
Copy link
Author

Happy to report that the new release fixes the issue.

As for the school, I don't mind sharing the name. I just have to make sure that me discussing a tool they use is not covered by the NDA we sign at the start of the course. I don't think it is, but I just want to be on the safe side.

For the IT department, I am only assuming that they might have made changes to the code since this didn't seem like an issue specific to my system. However, if I find out for sure that they have changed it, I will definitely encourage them to share their changes with you.

Thank you very much for your help and quick response.

@tb2097
Copy link
Owner

tb2097 commented Jun 14, 2018

Glad it is working correctly for you. I'll leave the issue open for a little for you to respond before closing it off. I don't think it should be an issue as it would be against the spirit of GPL for them to claim using it is covered under their NDA. However, if they have made modifications they can decide whether they want to provide it to me to roll into the main distribution.
https://www.gnu.org/licenses/gpl-faq.en.html#DoesTheGPLAllowNDA
https://www.gnu.org/licenses/gpl-faq.en.html#DevelopChangesUnderNDA

@jcpearson
Copy link

I guess the help page needs to be updated to include info on the new 'Cursor' page/tab ?

@jcpearson
Copy link

I notice you have updated help.html - but the descriptions for 'Touch' and 'Cursor' are swapped ...

@tb2097
Copy link
Owner

tb2097 commented Jun 19, 2018

Fixed help page gaff (not sure how I swapped those...). New release out with the help page correctly fixed. Closing issue.

@tb2097 tb2097 closed this as completed Jun 19, 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

3 participants