File tree 1 file changed +19
-5
lines changed
1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,17 @@ def show_console():
48
48
_console .edit .setFocus ()
49
49
50
50
51
-
52
51
_old_stdout = sys .stdout
53
52
_console_output = None
54
53
55
54
55
+ def clearConsole ():
56
+ global _console
57
+ if _console is None :
58
+ return
59
+ _console .edit .clearConsole ()
60
+
61
+
56
62
# hook for python console so all output will be redirected
57
63
# and then shown in console
58
64
def console_displayhook (obj ):
@@ -135,10 +141,8 @@ def __init__(self,parent=None):
135
141
self .setFont (monofont )
136
142
137
143
self .buffer = []
138
-
139
- self .insertTaggedText (QCoreApplication .translate ("PythonConsole" , "To access Quantum GIS environment from this console\n "
140
- "use qgis.utils.iface object (instance of QgisInterface class).\n \n " ),
141
- ConsoleHighlighter .INIT )
144
+
145
+ self .insertInitText ()
142
146
143
147
for line in _init_commands :
144
148
self .runsource (line )
@@ -149,6 +153,16 @@ def __init__(self,parent=None):
149
153
self .historyIndex = 0
150
154
151
155
self .high = ConsoleHighlighter (self )
156
+
157
+ def insertInitText (self ):
158
+ self .insertTaggedText (QCoreApplication .translate ("PythonConsole" , "To access Quantum GIS environment from this console\n "
159
+ "use qgis.utils.iface object (instance of QgisInterface class).\n \n " ),
160
+ ConsoleHighlighter .INIT )
161
+
162
+
163
+ def clearConsole (self ):
164
+ self .clear ()
165
+ self .insertInitText ()
152
166
153
167
def displayPrompt (self , more = False ):
154
168
self .currentPrompt = "... " if more else ">>> "
You can’t perform that action at this time.
0 commit comments