The eg
module¶
Everything special that is needed from EventGhost for scripting and writing
plugins is stuffed into the eg
module. It includes many functions,
variables, classes and objects. You could actually say eg
is EventGhost
itself.
Objects¶
-
eg.
event
¶ The
eg.EventGhostEvent
instance that is currently being processed.
-
eg.
globals
¶ Namespace that holds all global variables used by PythonCommand actions. PythonScripts (and all other code) can access these globals through
eg.globals
.
-
eg.
scheduler
¶ Instance of the single
eg.Scheduler
class.
Classes¶
- class
eg.PluginBase
- Base class of every EventGhost plugin written in Python.
- class
eg.ActionBase
- Base class of every action of a EventGhost plugin written in Python
- class
eg.SerialThread
- Eased handling of serial port communication.
- class
eg.ThreadWorker
- General purpose message pumping thread, that is used in many places.
- class
eg.ConfigPanel
- A panel with some magic.
- class
eg.Bunch
- Universal collection of a bunch of named stuff.
- class
eg.WindowMatcher
- Returns a list of window handles matching a number of criteria.
- class
eg.WindowsVersion
- A convenience module for checking the windows version.
wxPython Additions¶
- class
eg.SpinIntCtrl
- A wx.Control that shows a integer value and spin buttons to let the user easily input an integer value.
- class
eg.SpinNumCtrl
- A wx.Control that shows a fixed width floating point value and spin buttons to let the user easily input a floating point value.
- class
eg.MessageDialog
- A replacement for wx.MessageDialog, that wraps the message, if the dialog would get to wide.
- class
eg.DisplayChoice
- A wx.Choice control, that shows all available displays.
- class
eg.SerialPortChoice
- A wx.Choice control that shows all available serial ports on the system.
- class
eg.FileBrowseButton
- A control to allow the user to type in a filename or browse with the standard file dialog to select a file.
- class
eg.DirBrowseButton
- A control to allow the user to type in a filename or browse with the standard file dialog to select a directory.
- class
eg.FontSelectButton
- A button to select a font.
Functions¶
-
eg.
Exit
()[source] Sometimes you want to quickly exit a PythonScript, because you don’t want to build deeply nested if-structures for example. eg.Exit() will exit your PythonScript immediately. (Note: This is actually a sys.exit() but will not exit EventGhost, because the SystemExit exception is catched for a PythonScript.)
-
eg.
StopMacro
(ignoreReturn=False)[source] Instructs EventGhost to stop executing the current macro after the current action (thus the PythonScript or PythonCommand) has finished.
-
eg.
TriggerEvent
(suffix, payload=None, prefix='Main', source=<dynamic-module 'eg'>) Trigger an event
-
eg.
RegisterPlugin
(name=None, description=None, kind='other', author='[unknown author]', version='[unknown version]', icon=None, canMultiLoad=False, createMacrosOnAdd=False, url=None, help=None, guid=None, **kwargs)[source]¶ Registers information about a plugin to EventGhost.
Parameters: - name – should be a short descriptive string with the name of the plugin.
- description – a short description of the plugin.
- kind – gives a hint about the category the plugin belongs to. It
should be a string with a value out of
"remote"
(for remote receiver plugins),"program"
(for program control plugins),"external"
(for plugins that control external hardware) or"other"
(if none of the other categories match). - author – can be set to the name or a list of names of the developer(s) of the plugin.
- version – can be set to a version string.
- icon – can be a base64 encoded image for the plugin. If
icon == None
, an “icon.png” will be used if it exists in the plugin folder. - canMultiLoad – set this to
True
, if a configuration can have more than one instance of this plugin. - createMacrosOnAdd – if set to
True
, when adding the plugin, EventGhost will ask the user, if he/she wants to add a folder with all actions of this plugin to his/her configuration. - url – displays a clickable link in the plugin info dialog.
- help – a longer description and/or additional information for the plugin. Will be added to ‘description’.
- guid – will help EG to identify your plugin, so there are no name clashes with other plugins that accidentally might have the same name and will later ease the update of plugins.
- **kwargs – just to consume unknown parameters, to make the call backward compatible.
-
eg.
PrintError
(*args, **kwargs)¶ Prints an error message to the logger. The message will get a special icon and a red colour, so the user can easily identify it as an error message.