This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Ten Brushes python plugin isn't working

Tags: None
(comma "," separated)
andreys
Registered Member
Posts
2
Karma
0
When I press "ok" it gives me this error message:

AttributeError
Python 3.6.2: python
Thu Mar 22 21:13:52 2018

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

C:\Program Files\Krita (x64)\share\krita\pykrita\tenbrushes\tenbrushesdialog.py in accept(self=<tenbrushes.tenbrushesdialog.TenBrushesDialog object>)
21
22 def accept(self):
23 self.uitenbrushes.tentbrushes.writeSettings()
24
25 super(TenBrushesDialog, self).accept()
self = <tenbrushes.tenbrushesdialog.TenBrushesDialog object>
self.uitenbrushes = <tenbrushes.uitenbrushes.UITenBrushes object>
self.uitenbrushes.tentbrushes undefined
AttributeError: 'UITenBrushes' object has no attribute 'tentbrushes'
__cause__ = None
__class__ = <class 'AttributeError'>
__context__ = None
__delattr__ = <method-wrapper '__delattr__' of AttributeError object>
__dict__ = {}
__dir__ = <built-in method __dir__ of AttributeError object>
__doc__ = 'Attribute not found.'
__eq__ = <method-wrapper '__eq__' of AttributeError object>
__format__ = <built-in method __format__ of AttributeError object>
__ge__ = <method-wrapper '__ge__' of AttributeError object>
__getattribute__ = <method-wrapper '__getattribute__' of AttributeError object>
__gt__ = <method-wrapper '__gt__' of AttributeError object>
__hash__ = <method-wrapper '__hash__' of AttributeError object>
__init__ = <method-wrapper '__init__' of AttributeError object>
__init_subclass__ = <built-in method __init_subclass__ of type object>
__le__ = <method-wrapper '__le__' of AttributeError object>
__lt__ = <method-wrapper '__lt__' of AttributeError object>
__ne__ = <method-wrapper '__ne__' of AttributeError object>
__new__ = <built-in method __new__ of type object>
__reduce__ = <built-in method __reduce__ of AttributeError object>
__reduce_ex__ = <built-in method __reduce_ex__ of AttributeError object>
__repr__ = <method-wrapper '__repr__' of AttributeError object>
__setattr__ = <method-wrapper '__setattr__' of AttributeError object>
__setstate__ = <built-in method __setstate__ of AttributeError object>
__sizeof__ = <built-in method __sizeof__ of AttributeError object>
__str__ = <method-wrapper '__str__' of AttributeError object>
__subclasshook__ = <built-in method __subclasshook__ of type object>
__suppress_context__ = False
__traceback__ = <traceback object>
args = ("'UITenBrushes' object has no attribute 'tentbrushes'",)
with_traceback = <built-in method with_traceback of AttributeError object>

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
File "C:\Program Files\Krita (x64)\share\krita\pykrita\tenbrushes\tenbrushesdialog.py", line 23, in accept
self.uitenbrushes.tentbrushes.writeSettings()
AttributeError: 'UITenBrushes' object has no attribute 'tentbrushes'


Can I fix it?
User avatar
TheraHedwig
KDE Developer
Posts
1794
Karma
10
OS
It seems that a bug sneaked into this plugin. Which version are you using? Because someone did a fix for an earlier bug a few days ago, but this might also be related to a typo fix.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
I might've fixed that typo today, actually.
andreys
Registered Member
Posts
2
Karma
0
The version is 4.0.0
Drayldan
Registered Member
Posts
77
Karma
0
For me, this python scripting doesn't work, either.
Primo, when I set some brushes for shortcuts, pressing Alt+Ctrl+1 (or any other mapped number) doesn't work.
Secundo, when pressing "OK" I got this:
Code: Select all
AttributeError
Python 3.6.2: python
Fri Mar 23 23:56:24 2018

A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.

 C:\Program Files\Krita (x64)\share\krita\pykrita\tenbrushes\tenbrushesdialog.py in accept(self=<tenbrushes.tenbrushesdialog.TenBrushesDialog object>)
(...)
Traceback (most recent call last):
  File "C:\Program Files\Krita (x64)\share\krita\pykrita\tenbrushes\tenbrushesdialog.py", line 23, in accept
    self.uitenbrushes.tentbrushes.writeSettings()
AttributeError: 'UITenBrushes' object has no attribute 'tentbrushes'


Also, one can easily hang-up SCRIPTER by pressing "play" button (when there is no code chosen or created):
Code: Select all
AttributeError
Python 3.6.2: python
Sat Mar 24 00:04:05 2018
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
 C:\Program Files\Krita (x64)\share\krita\pykrita\scripter\ui_scripter\actions\runaction\runaction.py in run(self=<scripter.ui_scripter.actions.runaction.runaction.RunAction object>)
   64         stderr = sys.stderr
   65         output = docwrapper.DocWrapper(self.output.document())
   66         if (self.editor._documentModified is True):
   67             output.write("==== Warning: Script not saved! ====\n")
   68         else:
(...)
Traceback (most recent call last):
  File "C:\Program Files\Krita (x64)\share\krita\pykrita\scripter\ui_scripter\actions\runaction\runaction.py", line 66, in run
    if (self.editor._documentModified is True):
AttributeError: 'CodeEditor' object has no attribute '_documentModified'


Is it foolproof programmed? Looks like this "Python-side" element of new Krita is not quite finished yet, right? :o

My system is Win7 64-bit.
Drayldan
Registered Member
Posts
77
Karma
0
Any help, please? :< :o :(
User avatar
TheraHedwig
KDE Developer
Posts
1794
Karma
10
OS
Drayldan wrote:Any help, please? :< :o :(

You'll have to wait for the bugfix release. The 4.0 release builds were made earlier in the week, so they don't have this fix yet.

You can of course also try the 4.1 nightlies.
JoannesJ
Registered Member
Posts
11
Karma
0
To fix this, you can open "tenbrushesdialog.py" in a text-editor and correct the typo.
Remove the "t" from "tentbrushes" changing it to "tenbrushes".

I had to change the file permissions to be able to save my changes.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]