This module implements a QT4 python interpreter widget.

class openalea.oalab.shell.shell.PyCutExt(interpreter, message='', log='', parent=None)[source]

Bases: PySide.QtGui.QTextEdit, openalea.oalab.shell.streamredirection.GraphicalStreamRedirection

PyCute is a Python shell for PyQt.

Creating, displaying and controlling PyQt widgets from the Python command line interpreter is very hard, if not, impossible. PyCute solves this problem by interfacing the Python interpreter to a PyQt widget.

This class is inspired by PyCute.py : http://gerard.vermeulen.free.fr (GPL)

clear()[source]

Clear

color_line()[source]

Color the current line

contentsContextMenuEvent(ev)[source]

Suppress the right button context menu.

customEvent(event)[source]
dragEnterEvent(event)[source]
dragMoveEvent(event)[source]
dropEvent(event)[source]
fakeUser(lines)[source]

Simulate a user: lines is a sequence of strings, (Python statements).

flush()[source]

Simulate stdin, stdout, and stderr.

get_interpreter()[source]

Return the interpreter object

isatty()[source]

Simulate stdin, stdout, and stderr.

keyPressEvent(e)[source]

Handle user input a key at a time.

mousePressEvent(e)[source]

Keep the cursor after the last prompt.

moveCursor(operation, mode=PySide.QtGui.QTextCursor.MoveMode.MoveAnchor)[source]

Convenience function to move the cursor This function will be present in PyQT4.2

readline()[source]

Simulate stdin, stdout, and stderr.

write(text)[source]

Simulate stdin, stdout, and stderr.

writelines(text)[source]

Simulate stdin, stdout, and stderr.

staticMetaObject = <PySide.QtCore.QMetaObject object at 0x2adeeec4eb90>
class openalea.oalab.shell.shell.SyntaxColor[source]

Allow to color python keywords

get_color(word)[source]

Return a color tuple (R,G,B) depending of the string word

is_python_string(str)[source]

Return True if str is enclosed by a string mark

keywords = set(['and', 'elif', 'is', 'global', 'as', 'in', 'if', 'from', 'raise', 'for', 'except', 'finally', 'print', 'import', 'pass', 'return', 'exec', 'else', 'break', 'not', 'with', 'class', 'assert', 'yield', 'try', 'while', 'continue', 'del', 'or', 'def', 'lambda'])
openalea.oalab.shell.shell.get_shell_class()[source]
Returns:the shell class to instantiate
openalea.oalab.shell.shell.main()[source]

Previous topic

<no title>

Next topic

<no title>

This Page