-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpyderCOnsoleWidget.py
More file actions
26 lines (22 loc) · 916 Bytes
/
SpyderCOnsoleWidget.py
File metadata and controls
26 lines (22 loc) · 916 Bytes
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
from PyQt4.QtGui import QFont
from spyderlib.widgets.internalshell import InternalShell
from spyderlib.utils.module_completion import module_completion
class SpyderConsoleWidget(InternalShell):
def __init__(self, context=None):
my_locals = {
'context': context
}
super(SpyderConsoleWidget, self).__init__(namespace=my_locals)
self.setObjectName('SpyderConsoleWidget')
self.set_pythonshell_font(QFont('Mono'))
self.interpreter.restore_stds()
def get_module_completion(self, objtxt):
"""Return module completion list associated to object name"""
return module_completion(objtxt)
def run_command(self, *args):
self.interpreter.redirect_stds()
super(SpyderConsoleWidget, self).run_command(*args)
self.flush()
self.interpreter.restore_stds()
def shutdown(self):
self.exit_interpreter()