-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
56 lines (44 loc) · 1.81 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Module: main.py | [ Language Python ]
# Author: Gaps | sGaps | ArtGaps
# LICENSE: GPLv3 (available in ./LICENSE.txt)
# --------------------------------------------
"""
Main module. It's used to load the package as
a Krita Extension.
This defines a PixelExtension object that can
be used inside and outside Krita.
[:] Defined in this module
--------------------------
PixelExtension :: class
Used for manage the gui as a Krita Extension.
METADATA :: dict
Holds relevant information about the module, the path
and the name of the plugin inside Krita.
[*] Author
|- Gaps : sGaps : ArtGaps
"""
from .Context import CONTEXT , Extension
from .SetupGUI import GUI , main , test
METADATA = { "SYS_ID" : "pykrita_pixel_border" ,
"NAM_ID" : "Pixel Borders" ,
"TOOL_PATH" : "tools/scripts" ,
"TITLE" : "Pixel Borders" }
class PixelExtension( Extension ):
""" Wrapper class for the GUI class. """
def __init__( self , parent ):
""" Initialize this object using the QT C++ interface """
super().__init__( parent )
def setup( self ):
""" Defined only for compatibility purposes."""
pass
def createActions( self , window ):
""" Used by krita. This makes a valid entry for the plugin in the 'scripts'
button of Krita"""
action = window.createAction( METADATA["SYS_ID"] ,
METADATA["NAM_ID"] ,
METADATA["TOOL_PATH"] )
action.triggered.connect( self.run )
def run( self ):
""" perform the required actions to run the script in krita. """
self.ext = GUI( parent = None , title = METADATA["TITLE"] )
self.ext.run()