Common functions used for the psyplot gui
Classes:
A mixin class to define psyplot_gui plugins |
|
|
A validator class to validate that a string consists of strings in a list of strings |
|
A toolbutton to load an object from the console |
Widget designed to display python errors via the |
|
|
Fake file-like stream object that redirects writes to a logger instance. |
Functions:
|
Get the path to an icon in the icons directory |
|
Return module modname base path |
Check if there are any GUI tests running |
- class psyplot_gui.common.DockMixin[source]
Bases:
object
A mixin class to define psyplot_gui plugins
Notes
Each external plugin should set the
dock_position
and thetitle
attribute!Attributes:
The config page for this widget.
The instance of
QDockWidget
of this pluginThe position of the plugin
Boolean that is True if the dock widget should be hidden automatically after startup
Boolean that is True, if the dock widget is shown
The title of the plugin
Methods:
Setup the action to make this plugin the central widget
create_view_action
(main[, docktype])Hide the plugin widget
position_dock
(main, *args, **kwargs)Set the position of the dock widget
Remove this plugin and close it
Show the plugin widget
show_status_message
(msg)Show a status message
to_dock
(main[, title, position, docktype])Classes:
The class to use for the DockWidget
- config_page = None
The config page for this widget. Should inherit the
psyplot_gui.preferences.ConfigPage
widget
- dock = None
The instance of
QDockWidget
of this plugin
- dock_cls
The class to use for the DockWidget
alias of
QDockWidget
Attributes:AllDockWidgetFeatures
DockWidgetClosable
DockWidgetFloatable
DockWidgetMovable
DockWidgetVerticalTitleBar
NoDockWidgetFeatures
allowedAreasChanged
(*args, **kwargs)Union[Qt.DockWidgetAreas, Qt.DockWidgetArea]) [signal]
dockLocationChanged
(*args, **kwargs)Qt.DockWidgetArea) [signal]
featuresChanged
(*args, **kwargs)Union[QDockWidget.DockWidgetFeatures, QDockWidget.DockWidgetFeature]) [signal]
topLevelChanged
(*args, **kwargs)bool) [signal]
visibilityChanged
(*args, **kwargs)bool) [signal]
Classes:
DockWidgetFeature
DockWidgetFeatures
()Methods:
allowedAreas
(self)changeEvent
(self, event)closeEvent
(self, event)event
(self, event)features
(self)initStyleOption
(self, option)isAreaAllowed
(self, area)isFloating
(self)paintEvent
(self, event)setAllowedAreas
(self, areas)setFeatures
(self, features)setFloating
(self, floating)setTitleBarWidget
(self, widget)setWidget
(self, widget)titleBarWidget
(self)toggleViewAction
(self)widget
(self)
- dock_position = None
The position of the plugin
Boolean that is True if the dock widget should be hidden automatically after startup
- property is_shown
Boolean that is True, if the dock widget is shown
- position_dock(main, *args, **kwargs)[source]
Set the position of the dock widget
This method places the plugin widget at the desired dock position (by default, indicated with the
dock_position
attribute)- Parameters:
main (psyplot_gui.main.Mainwindow) – The main window where the dock is added
- title = None
The title of the plugin
- class psyplot_gui.common.ListValidator(valid, sep=',', *args, **kwargs)[source]
Bases:
QRegExpValidator
A validator class to validate that a string consists of strings in a list of strings
- class psyplot_gui.common.LoadFromConsoleButton(instances=None, *args, **kwargs)[source]
Bases:
QToolButton
A toolbutton to load an object from the console
Methods:
check
(obj)get_from_shell
([oname])Open an input dialog, receive an object and emit the
object_loaded
signalget_obj
(oname)Load an object from the current shell
Attributes:
object_loaded
(*args, **kwargs)The signal that is emitted when an object has been loaded.
- get_from_shell(oname=None)[source]
Open an input dialog, receive an object and emit the
object_loaded
signal
- property instances2check_str
- object_loaded(*args, **kwargs)
The signal that is emitted when an object has been loaded. The first argument is the object name, the second the object itself
- property potential_object_names
- class psyplot_gui.common.PyErrorMessage[source]
Bases:
QErrorMessage
Widget designed to display python errors via the
showTraceback()
methodMethods:
excepthook
(type, value, traceback)showTraceback
([header])
- class psyplot_gui.common.StreamToLogger(logger, log_level=20)[source]
Bases:
object
Fake file-like stream object that redirects writes to a logger instance.
Methods:
flush
()write
(buf)
- psyplot_gui.common.is_running_tests()[source]
Check if there are any GUI tests running
This function returns the
psyplot_gui.UNIT_TESTING
variable