I am updating my plugin for the Krita 6.0 and PyQt6 and it seems that AppDataLocation is missing from QStandardPaths
I need a way to find the path for the resources folder, currently I am doing this:
resources=os.path.join(QStandardPaths.writableLocation(QStandardPaths.AppDataLocation), 'pykrita', 'piplib')
But it’s giving me this error
krita.scripting: " File \"C:\\Users\\Davi\\AppData\\Roaming\\krita\\pykrita\\BrushSfx\\dependencies.py\", line 29, in pipInstallPath"
krita.scripting: " returned=os.path.join(QStandardPaths.writableLocation(QStandardPaths.AppDataLocation), 'pykrita', 'piplib')"
krita.scripting: " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
krita.scripting: "AttributeError: type object 'QStandardPaths' has no attribute 'AppDataLocation'"
According with PyQt6 docs, QStandardPaths should have an .AppDataLocation, but its missing on Krita 6.0
This code on krita 5.3: (using the Qt lib suggested in another topic)
from .Qt.QtCore import QStandardPaths
print(dir(QStandardPaths))
gives:
['AppConfigLocation', 'AppDataLocation', 'AppLocalDataLocation', 'ApplicationsLocation',
'CacheLocation', 'ConfigLocation', 'DataLocation', 'DesktopLocation', 'DocumentsLocation',
'DownloadLocation', 'FontsLocation', 'GenericCacheLocation', 'GenericConfigLocation',
'GenericDataLocation', 'HomeLocation', 'LocateDirectory', 'LocateFile', 'LocateOption',
'LocateOptions', 'MoviesLocation', 'MusicLocation', 'PicturesLocation', 'RuntimeLocation',
'StandardLocation', 'TempLocation', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__',
'__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'__weakref__', 'displayName', 'enableTestMode', 'findExecutable', 'locate', 'locateAll',
'setTestModeEnabled', 'standardLocations', 'writableLocation']
But this code on Krita 6.0:
from PyQt6.QtCore import QStandardPaths
print(dir(QStandardPaths))
gives:
['LocateOption', 'StandardLocation', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__',
'__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'__weakref__', 'displayName', 'findExecutable', 'locate', 'locateAll', 'setTestModeEnabled',
'standardLocations', 'writableLocation']
Is there a new or more adequated method to get the resources path?
I am currently using Windows 10