mcsas.gui.bases.logwidget module

class LogWidget(parent=None, appversion=None)[source]

Bases: QTextBrowser, gui.bases.mixins.contextmenuwidget.ContextMenuWidget

Simple TextEdit which can save its contents to file.

Fill it with text. >>> from gui.utils.dialoginteraction import DialogInteraction >>> from gui.widgets.logwidget import LogWidget >>> testdata = ‘blablubbanblubb’ >>> te = DialogInteraction.instance(LogWidget) >>> te.append(testdata) >>> te.contents() == testdata True

Call save to file dialog and save. >>> fn = str(DialogInteraction.query(fileDialogType(), te.saveToFile, ... slot = ‘accept’))

Verify written data and remove test file. >>> import os >>> data = None >>> if fn is not None: ... data = open(fn).read() ... os.remove(fn) >>> data == testdata True

PlainTextEdit Tests: Simple TextEdit which can save its contents to file.

Fill it with text. >>> from utilsgui import DialogInteraction, fileDialogType >>> from plaintextedit import PlainTextEdit >>> testdata = ‘blablubbanblubb’ >>> te = DialogInteraction.instance(PlainTextEdit) >>> te.appendPlainText(testdata) >>> te.toPlainText() == testdata True

Call save to file dialog and save. >>> fn = str(DialogInteraction.query(fileDialogType(), te.saveToFile, ... slot = ‘accept’))

Verify written data and remove test file. >>> import os >>> data = None >>> if fn is not None: ... data = open(fn).read() ... os.remove(fn) >>> data == testdata True

addWatchDir(path)[source]

Adds a directory to check for plotlog messages from multiprocessing.

append(text)[source]

Appends a new line of text.

appversion
clear()[source]

Warning

method ‘gui.bases.logwidget.LogWidget.clear’ undocumented

contents()[source]

Warning

method ‘gui.bases.logwidget.LogWidget.contents’ undocumented

isCopyAvailable()[source]

Warning

method ‘gui.bases.logwidget.LogWidget.isCopyAvailable’ undocumented

isEmpty()[source]

Warning

method ‘gui.bases.logwidget.LogWidget.isEmpty’ undocumented

onCloseSlot()[source]

Workaround to exit a program during calculation. Logging a message processes Qt events (see append()). It makes sure this slot is called if connected to a application close signal. For example, emitted by the main window on closeEvent().

saveToFile(filename=None)[source]

Warning

method ‘gui.bases.logwidget.LogWidget.saveToFile’ undocumented

scrollToBottom()[source]

Warning

method ‘gui.bases.logwidget.LogWidget.scrollToBottom’ undocumented

scrollToTop()[source]

Warning

method ‘gui.bases.logwidget.LogWidget.scrollToTop’ undocumented

setCopyAvailable(yes)[source]

Warning

method ‘gui.bases.logwidget.LogWidget.setCopyAvailable’ undocumented

title = None
url2href(text)[source]

http://daringfireball.net/2010/07/improved_regex_for_matching_urls