File indexing completed on 2025-01-26 04:11:39
0001 """ 0002 SPDX-FileCopyrightText: 2017 Eliakin Costa <eliakim170@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 """ 0006 from PyQt5.QtCore import QSettings, QStandardPaths 0007 from krita import Krita, Extension 0008 from . import uicontroller, documentcontroller, debugcontroller 0009 0010 0011 class ScripterExtension(Extension): 0012 0013 def __init__(self, parent): 0014 super(ScripterExtension, self).__init__(parent) 0015 0016 def setup(self): 0017 pass 0018 0019 def createActions(self, window): 0020 action = window.createAction("python_scripter", i18n("Scripter")) 0021 action.triggered.connect(self.initialize) 0022 0023 def initialize(self): 0024 configPath = QStandardPaths.writableLocation(QStandardPaths.GenericConfigLocation) 0025 self.settings = QSettings(configPath + '/krita-scripterrc', QSettings.IniFormat) 0026 self.uicontroller = uicontroller.UIController() 0027 self.documentcontroller = documentcontroller.DocumentController() 0028 self.debugcontroller = debugcontroller.DebugController(self) 0029 self.uicontroller.initialize(self) 0030 0031 0032 Krita.instance().addExtension(ScripterExtension(Krita.instance()))