author | Andrey Skvortsov <andrej.skvortzov@gmail.com> |
Fri, 13 Jan 2017 15:08:40 +0300 | |
changeset 1629 | 80eee3c5a057 |
parent 1511 | 91538d0c242c |
child 1735 | c02818d7e29f |
permissions | -rw-r--r-- |
1511
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
1 |
#!/usr/bin/env python |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
2 |
# -*- coding: utf-8 -*- |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
3 |
|
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
4 |
# This file is part of Beremiz, a Integrated Development Environment for |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
5 |
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival. |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
6 |
# |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
7 |
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
8 |
# |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
9 |
# See COPYING file for copyrights details. |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
10 |
# |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
11 |
# This program is free software; you can redistribute it and/or |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
12 |
# modify it under the terms of the GNU General Public License |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
13 |
# as published by the Free Software Foundation; either version 2 |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
14 |
# of the License, or (at your option) any later version. |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
15 |
# |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
16 |
# This program is distributed in the hope that it will be useful, |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
17 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
18 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
19 |
# GNU General Public License for more details. |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
20 |
# |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
21 |
# You should have received a copy of the GNU General Public License |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
22 |
# along with this program; if not, write to the Free Software |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
23 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
91538d0c242c
add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1347
diff
changeset
|
24 |
|
14
eb9fdd316a40
More precise design for plugins.... to be continued...
etisserant
parents:
13
diff
changeset
|
25 |
""" |
725 | 26 |
Minimal tab controller for a simple text editor |
14
eb9fdd316a40
More precise design for plugins.... to be continued...
etisserant
parents:
13
diff
changeset
|
27 |
""" |
eb9fdd316a40
More precise design for plugins.... to be continued...
etisserant
parents:
13
diff
changeset
|
28 |
|
725 | 29 |
import os |
14
eb9fdd316a40
More precise design for plugins.... to be continued...
etisserant
parents:
13
diff
changeset
|
30 |
|
65 | 31 |
class MiniTextControler: |
32 |
||
806
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
33 |
def __init__(self, filepath, controller): |
65 | 34 |
self.FilePath = filepath |
806
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
35 |
self.BaseController = controller |
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
36 |
|
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
37 |
def __del__(self): |
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
38 |
self.BaseController = None |
716
180e4a7d945c
Adding search field for finding function or function block in library tree
laurent
parents:
715
diff
changeset
|
39 |
|
718 | 40 |
def CTNFullName(self): |
716
180e4a7d945c
Adding search field for finding function or function block in library tree
laurent
parents:
715
diff
changeset
|
41 |
return "" |
180e4a7d945c
Adding search field for finding function or function block in library tree
laurent
parents:
715
diff
changeset
|
42 |
|
74 | 43 |
def SetEditedElementText(self, tagname, text): |
65 | 44 |
file = open(self.FilePath, "w") |
45 |
file.write(text) |
|
46 |
file.close() |
|
47 |
||
273 | 48 |
def GetEditedElementText(self, tagname, debug = False): |
65 | 49 |
if os.path.isfile(self.FilePath): |
50 |
file = open(self.FilePath, "r") |
|
51 |
text = file.read() |
|
52 |
file.close() |
|
53 |
return text |
|
54 |
return "" |
|
55 |
||
1347
533741e5075c
Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
806
diff
changeset
|
56 |
def GetEditedElementInterfaceVars(self, tagname, tree=False, debug = False): |
74 | 57 |
return [] |
58 |
||
273 | 59 |
def GetEditedElementType(self, tagname, debug = False): |
74 | 60 |
return "program" |
61 |
||
806
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
62 |
def GetBlockType(self, type, inputs = None, debug = False): |
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
63 |
return self.BaseController.GetBlockType(type, inputs, debug) |
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
64 |
|
273 | 65 |
def GetBlockTypes(self, tagname = "", debug = False): |
806
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
66 |
return self.BaseController.GetBlockTypes(tagname, debug) |
74 | 67 |
|
630
91b2ae63ea3d
Including external tools for editing plugin informations into Beremiz window
laurent
parents:
624
diff
changeset
|
68 |
def GetDataTypes(self, tagname = "", basetypes = True, only_locatables = False, debug = False): |
806
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
69 |
return self.BaseController.GetDataTypes(tagname, basetypes, only_locatables, debug) |
630
91b2ae63ea3d
Including external tools for editing plugin informations into Beremiz window
laurent
parents:
624
diff
changeset
|
70 |
|
273 | 71 |
def GetEnumeratedDataValues(self, debug = False): |
806
abf1afc1f04d
Fix bug when closing IECCodeView and IECRawCodeView, reopening them was impossible
laurent
parents:
725
diff
changeset
|
72 |
return self.BaseController.GetEnumeratedDataValues(debug) |
74 | 73 |
|
65 | 74 |
def StartBuffering(self): |
75 |
pass |
|
76 |
||
77 |
def EndBuffering(self): |
|
78 |
pass |
|
79 |
||
80 |
def BufferProject(self): |
|
81 |
pass |
|
82 |