openalea.oalab.editor package

Submodules

openalea.oalab.editor.completion module

class openalea.oalab.editor.completion.DictionaryCompleter(parent=None)[source]

Bases: PyQt4.QtGui.QCompleter

add_words(words)[source]

Add a list of words into dict

update_dict()[source]

Use it to add new words from locals() and globals()

openalea.oalab.editor.goto module

class openalea.oalab.editor.goto.GoToWidget(parent=None)[source]

Bases: PyQt4.QtGui.QWidget

go()[source]

openalea.oalab.editor.highlight module

class openalea.oalab.editor.highlight.Highlighter(parent, lexer=None)[source]

Bases: PyQt4.QtGui.QSyntaxHighlighter

highlightBlock(string)[source]

Highlight a block of text.

set_style(style)[source]

Sets the style to the specified Pygments style.

set_style_sheet(stylesheet)[source]

Sets a CSS stylesheet. The classes in the stylesheet should correspond to those generated by:

pygmentize -S <style> -f html

Note that ‘set_style’ and ‘set_style_sheet’ completely override each other, i.e. they cannot be used in conjunction.

class openalea.oalab.editor.highlight.PygmentsBlockUserData(**kwds)[source]

Bases: PyQt4.QtGui.QTextBlockUserData

Storage for the user data associated with each line.

syntax_stack = ('root',)

openalea.oalab.editor.line_number module

class openalea.oalab.editor.line_number.Margin(parent, editor)[source]

Bases: PyQt4.QtGui.QWidget

mousePressEvent(event)[source]
paintEvent(paintEvent)[source]

openalea.oalab.editor.lpy_lexer module

pygments.lexers.lpy

Lexers for L-Py language.

copyright:Copyright 2006-2013 by the Pygments team, see AUTHORS.
license:BSD, see LICENSE for details.
authors:Julien COSTE, Guillaume BATY, Frederic BOUDON, Christophe PRADAL
homepage:http://openalea.gforge.inria.fr/wiki/doku.php?id=packages:vplants:lpy:main
class openalea.oalab.editor.lpy_lexer.LPyLexer(**options)[source]

Bases: pygments.lexers.agile.PythonLexer

Lexer for LPy language.

aliases = ['lpy', 'Lpy', 'LPy', 'l-py', 'L-py', 'L-Py']
filenames = ['*.lpy']
get_tokens_unprocessed(text)[source]
mimetypes = ['text/x-python', 'application/x-python']
module_callback(lexer, match)[source]

Permit to detect and stock words after special words “axiom” and “module”. This words are then colourized like other keywords.

name = 'LPy'
tokens = {'lpykeywords': [('(^Axiom|^module)', Token.Generic.Subheading, 'module'), ('(^derivation length|-->|-static->|decomposition|^production|produce|homomorphism|^interpretation|group|^endlsystem|endgroup|maximum depth|nproduce|nsproduce|makestring|consider|ignore|forward|backward|isForward|StartEach|EndEach|Start|End|getGroup|useGroup|getIterationNb|module|@static|lpyimport)', Token.Generic.Subheading)], 'root': ['lpykeywords', inherit], 'module': [('(\\w*)(\\(.*\\))', <function module_callback at 0x10950f398>), ('( )(\\w*)( |$)', <function module_callback at 0x10950f398>), ('(:| )', Token.Text)]}

openalea.oalab.editor.search module

class openalea.oalab.editor.search.SearchWidget(parent=None, session=None)[source]

Bases: PyQt4.QtGui.QWidget

replaceall()[source]
search()[source]
searchBack()[source]

openalea.oalab.editor.text_editor module

class openalea.oalab.editor.text_editor.RichTextEditor(session, controller, parent=None)[source]

Bases: PyQt4.QtGui.QWidget

actions()[source]
Returns:list of actions to set in the menu.
comment()[source]
get_selected_text()[source]
get_text(start='sof', end='eof')[source]

Return a part of the text.

Parameters:
  • start – is the begining of what you want to get
  • end – is the end of what you want to get
Returns:

text which is contained in the editor between ‘start’ and ‘end’

goto()[source]
mainMenu()[source]
redo()[source]
save(name=None)[source]
search()[source]
set_script(txt)

Set text in the editor

Parameters:text – text you want to set
set_text(txt)[source]

Set text in the editor

Parameters:text – text you want to set
uncomment()[source]
undo()[source]
class openalea.oalab.editor.text_editor.TextEditor(session, controller, parent=None)[source]

Bases: PyQt4.QtGui.QTextEdit

actions()[source]
Returns:list of actions to set in the menu.
comment()[source]
display_line_number()[source]
focusInEvent(event)[source]
get_selected_text()[source]
get_text(start='sof', end='eof')[source]

Return a part of the text.

Parameters:
  • start – is the begining of what you want to get
  • end – is the end of what you want to get
Returns:

text which is contained in the editor between ‘start’ and ‘end’

go_to_line(lineno)[source]
insertCompletion(completion)[source]
keyPressEvent(event)[source]
mainMenu()[source]
resizeEvent(event)[source]
returnEvent()[source]
save(name=None)[source]

Save current file.

Parameters:name – name of the file to save.

If not name, self.name is used. If self.name is not setted and name is not give in parameter, a File Dialog is opened.

scrollContentsBy(dx, dy)[source]
setCompleter(completer)[source]
setText(txt)[source]
set_script(txt)

Set text in the editor

Parameters:text – text you want to set
set_tab_size()[source]
set_text(txt)[source]

Set text in the editor

Parameters:text – text you want to set
textUnderCursor()[source]
uncomment()[source]

Module contents