Krita Source Code Documentation
Loading...
Searching...
No Matches
document.py
Go to the documentation of this file.
1
"""
2
SPDX-FileCopyrightText: 2017 Eliakin Costa <eliakim170@gmail.com>
3
4
SPDX-License-Identifier: GPL-2.0-or-later
5
"""
6
7
class
Document
(object):
8
9
def
__init__
(self, filePath):
10
self.
_document
= []
11
self.
_filePath
= filePath
12
13
def
open
(self, filePath=''):
14
if
filePath:
15
self.
_filePath
= filePath
16
17
with
open
(self.
_filePath
,
'r'
)
as
pythonFile:
18
self.
_document
= pythonFile.read()
19
20
def
save
(self):
21
with
open
(self.
_filePath
,
'w'
)
as
pythonFile:
22
pythonFile.write(self.
_document
)
23
24
def
compare
(self, new_doc):
25
if
len(self.
_document
) != len(new_doc):
26
return
False
27
28
if
new_doc != self.
_document
:
29
return
False
30
31
return
True
32
33
@property
34
def
data
(self):
35
return
self.
_document
36
37
@data.setter
38
def
data
(self, data):
39
self.
_document
= data
40
41
@property
42
def
filePath
(self):
43
return
self.
_filePath
scripter.document_scripter.document.Document
Definition
document.py:7
scripter.document_scripter.document.Document.data
data(self)
Definition
document.py:34
scripter.document_scripter.document.Document.__init__
__init__(self, filePath)
Definition
document.py:9
scripter.document_scripter.document.Document._filePath
_filePath
Definition
document.py:11
scripter.document_scripter.document.Document.open
open(self, filePath='')
Definition
document.py:13
scripter.document_scripter.document.Document.compare
compare(self, new_doc)
Definition
document.py:24
scripter.document_scripter.document.Document.save
save(self)
Definition
document.py:20
scripter.document_scripter.document.Document.filePath
filePath(self)
Definition
document.py:42
scripter.document_scripter.document.Document._document
_document
Definition
document.py:10
plugins
python
scripter
document_scripter
document.py
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52