# terminatorlib package

## Subpackages

- terminatorlib.configobj package
  - Submodules
  - terminatorlib.configobj.configobj module
  - terminatorlib.configobj.validate module
  - Module contents
- terminatorlib.plugins package
  - Submodules
  - terminatorlib.plugins.activitywatch module
  - terminatorlib.plugins.custom_commands module
  - terminatorlib.plugins.logger module
  - terminatorlib.plugins.maven module
  - terminatorlib.plugins.terminalshot module
  - terminatorlib.plugins.testplugin module
  - terminatorlib.plugins.url_handlers module
  - Module contents

## Submodules

## terminatorlib.borg module

borg.py - We are the borg. Resistance is futile.

http://code.activestate.com/recipes/66531/ ActiveState’s policy appears to be that snippets exist to encourage re-use, but I can not find any specific licencing terms.

class `terminatorlib.borg.``Borg`(borgtype=None)

  Definition of a class that can never be duplicated. Correct usage is thus:

      >>> from borg import Borg
      >>> class foo(Borg):
      ...     # All attributes on a borg class *must* = None
      ...     attribute = None
      ...     def __init__(self):
      ...         Borg.__init__(self, self.__class__.__name__)
      ...     def prepare_attributes(self):
      ...         if not self.attribute:
      ...             self.attribute = []
      ...
      >>> bar = foo()
      >>> bar.prepare_attributes()

  The important thing to note is that all attributes of borg classes must be declared as being None. If you attempt to use static class attributes you will get unpredicted behaviour. Instead, prepare_attributes() must be called which will then see the attributes in the shared state, and initialise them if necessary.

  `__init__`(borgtype=None)

    Class initialiser. Overwrite our class dictionary with the shared state. This makes us identical to every other instance of this class type.

  `prepare_attributes`()

    This should be used to prepare any attributes of the borg class.

  `_Borg__shared_state` = {}

## terminatorlib.config module

Terminator by Chris Jones <cmsj@tenshu.net>

Classes relating to configuration

    >>> DEFAULTS['global_config']['focus']
    'click'
    >>> config = Config()
    >>> config['focus'] = 'sloppy'
    >>> config['focus']
    'sloppy'
    >>> DEFAULTS['global_config']['focus']
    'click'
    >>> config2 = Config()
    >>> config2['focus']
    'sloppy'
    >>> config2['focus'] = 'click'
    >>> config2['focus']
    'click'
    >>> config['focus']
    'click'
    >>> config['geometry_hinting'].__class__.__name__
    'bool'
    >>> plugintest = {}
    >>> plugintest['foo'] = 'bar'
    >>> config.plugin_set_config('testplugin', plugintest)
    >>> config.plugin_get_config('testplugin')
    {'foo': 'bar'}
    >>> config.plugin_get('testplugin', 'foo')
    'bar'
    >>> config.plugin_get('testplugin', 'foo', 'new')
    'bar'
    >>> config.plugin_get('testplugin', 'algo')
    Traceback (most recent call last):
    ...
    KeyError: 'ConfigBase::get_item: unknown key algo'
    >>> config.plugin_get('testplugin', 'algo', 1)
    1
    >>> config.plugin_get('anothertestplugin', 'algo', 500)
    500
    >>> config.get_profile()
    'default'
    >>> config.set_profile('my_first_new_testing_profile')
    >>> config.get_profile()
    'my_first_new_testing_profile'
    >>> config.del_profile('my_first_new_testing_profile')
    >>> config.get_profile()
    'default'
    >>> config.list_profiles().__class__.__name__
    'list'
    >>> config.options_set({})
    >>> config.options_get()
    {}
    >>>

class `terminatorlib.config.``Config`(profile='default')

  Bases: `object`

  Class to provide a slightly richer config API above ConfigBase

  `__getitem__`(key, default=None)

    Look up a configuration item

  `__init__`(profile='default')
  `__setitem__`(key, value)

    Set a particular configuration item

  `add_layout`(name, layout)

    Add a new layout

  `add_profile`(profile)

    Add a new profile

  `del_layout`(layout)

    Delete a layout

  `del_profile`(profile)

    Delete a profile

  `get_profile`()

    Get our profile

  `get_system_focus`()

    Look up the system focus setting

  `get_system_mono_font`()

    Look up the system font

  `get_system_prop_font`()

    Look up the system font

  `inhibit_save`()

    Prevent calls to save() being honoured

  `layout_get_config`(layout)

    Return a layout

  `layout_set_config`(layout, tree)

    Set a layout

  `list_layouts`()

    List all configured layouts

  `list_profiles`()

    List all configured profiles

  `on_gconf_notify`(_client, _cnxn_id, _entry, _what)

    Handle a gconf watch changing

  `options_get`()

    Get the command line options

  `options_set`(options)

    Set the command line options

  `plugin_del_config`(plugin)

    Delete a whole config tree for a given plugin

  `plugin_get`(pluginname, key, default=None)

    Get a plugin config value, if doesn’t exist return default if specified

  `plugin_get_config`(plugin)

    Return a whole config tree for a given plugin

  `plugin_set`(pluginname, key, value)

    Set a plugin config value

  `plugin_set_config`(plugin, tree)

    Set a whole config tree for a given plugin

  `rename_layout`(layout, newname)

    Rename a layout

  `rename_profile`(profile, newname)

    Rename a profile

  `replace_layout`(name, layout)

    Replace an existing layout

  `save`()

    Cause ConfigBase to save our config to file

  `set_profile`(profile, force=False)

    Set our profile (which usually means change it)

  `uninhibit_save`()

    Allow calls to save() to be honoured

  `base` = None
  `gconf` = None
  `inhibited` = None
  `profile` = None
  `system_focus` = None
  `system_mono_font` = None
  `system_prop_font` = None

class `terminatorlib.config.``ConfigBase`

  Bases: `terminatorlib.borg.Borg`

  Class to provide access to our user configuration

  `__init__`()

    Class initialiser

  `add_layout`(name, layout)

    Add a new layout

  `add_profile`(profile)

    Add a new profile

  `defaults_to_configspec`()

    Convert our tree of default values into a ConfigObj validation specification

  `del_plugin`(plugin)

    Delete a whole tree for a plugin

  `get_item`(key, profile='default', plugin=None, default=None)

    Look up a configuration item

  `get_layout`(layout)

    Return a layout

  `get_plugin`(plugin)

    Return a whole tree for a plugin

  `load`()

    Load configuration data from our various sources

  `prepare_attributes`()

    Set up our borg environment

  `reload`()

    Force a reload of the base config

  `replace_layout`(name, layout)

    Replaces a layout with the given name

  `save`()

    Save the config to a file

  `set_item`(key, value, profile='default', plugin=None)

    Set a configuration item

  `set_layout`(layout, tree)

    Set a layout

  `set_plugin`(plugin, tree)

    Set a whole tree for a plugin

  `command_line_options` = None
  `global_config` = None
  `keybindings` = None
  `layouts` = None
  `loaded` = None
  `plugins` = None
  `profiles` = None
  `sections` = None
  `whined` = None

## terminatorlib.container module

container.py - classes necessary to contain Terminal widgets

class `terminatorlib.container.``Container`

  Bases: `object`

  Base class for Terminator Containers

  `__init__`()

    Class initialiser

  `add`(widget, metadata=None)

    Add a widget to the container

  `closeterm`(widget)

    Handle the closure of a terminal

  `connect_child`(widget, signal, handler, *args)

    Register the requested signal and record its connection ID

  `construct_confirm_close`(window, reqtype)

    Create a confirmation dialog for closing things

  `create_layout`(layout)

    Apply settings for our layout

  `describe_layout`(count, parent, global_layout, child_order)

    Describe our current layout

  `disconnect_child`(widget)

    De-register the signals for a child

  `get_child_metadata`(widget)

    Return metadata that would be useful to recreate ourselves after our child is .remove()d and .add()ed

  `get_children`()

    Return an ordered list of the children of this Container

  `get_offspring`()

    Return a list of direct child widgets, if any

  `get_visible_terminals`()

    Walk the widget tree to find all of the visible terminals. That is, any terminals which are not hidden in another Notebook pane

  `hoover`()

    Ensure we still have a reason to exist

  `propagate_title_change`(widget, title)

    Pass a title change up the widget stack

  `register_signals`(widget)

    Register gobject signals in a way that avoids multiple inheritance

  `remove`(widget)

    Remove a widget from the container

  `replace`(oldwidget, newwidget)

    Replace the child oldwidget with newwidget. This is the bare minimum required for this operation. Containers should override it if they have more complex requirements

  `resizeterm`(widget, keyname)

    Handle a keyboard event requesting a terminal resize

  `rotate`(widget, clockwise)

    Rotate children in this container

  `split_axis`(widget, vertical=True, cwd=None, sibling=None, siblinglast=None)

    Default axis splitter. This should be implemented by subclasses

  `split_horiz`(widget, cwd=None)

    Split this container horizontally

  `split_vert`(widget, cwd=None)

    Split this container vertically

  `toggle_zoom`(widget, fontscale=False)

    Toggle the existing zoom state

  `unzoom`(widget)

    Unzoom a terminal

  `zoom`(widget, fontscale=False)

    Zoom a terminal

  `children` = None
  `config` = None
  `immutable` = None
  `signalman` = None
  `signals` = None
  `terminator` = None

## terminatorlib.cwd module

cwd.py - function necessary to get the cwd for a given pid on various OSes

    >>> cwd = get_default_cwd()
    >>> cwd.__class__.__name__
    'str'
    >>> func = get_pid_cwd()
    >>> func.__class__.__name__
    'function'

`terminatorlib.cwd.``get_default_cwd`()

  Determine a reasonable default cwd

`terminatorlib.cwd.``get_pid_cwd`()

  Determine an appropriate cwd function for the OS we are running on

`terminatorlib.cwd.``linux_get_pid_cwd`(pid)

  Determine the cwd for a given PID on Linux kernels

`terminatorlib.cwd.``proc_get_pid_cwd`(pid, path)

  Extract the cwd of a PID from proc, given the PID and the /proc path to insert it into, e.g. /proc/%s/cwd

`terminatorlib.cwd.``psutil_cwd`(pid)

  Determine the cwd using psutil which also supports Darwin

`terminatorlib.cwd.``sunos_get_pid_cwd`(pid)

  Determine the cwd for a given PID on SunOS kernels

## terminatorlib.debugserver module

class `terminatorlib.debugserver.``PythonConsoleServer`(request, client_address, server)

  Bases: `SocketServer.BaseRequestHandler`

  `finish`()
  `handle`()
  `setup`()
  `verify_request`(request, client_address)
  `env` = None

class `terminatorlib.debugserver.``TerminatorConsole`(locals=None, filename='<console>')

  Bases: `code.InteractiveConsole`

  `parse_telnet`(data)
  `raw_input`(prompt=None)
  `run`(server)
  `write`(data)

`terminatorlib.debugserver.``ddbg`(msg)

`terminatorlib.debugserver.``spawn`(env)

## terminatorlib.editablelabel module

Editable Label class

class `terminatorlib.editablelabel.``EditableLabel`(text='')

  Bases: `gtk.EventBox`

  An eventbox that partialy emulate a gtk.Label On double-click, the label is editable, entering an empty will revert back to automatic text

  `__init__`(text='')

    Class initialiser

  `_entry_to_label`(widget, event)

    replace gtk.Entry by the gtk.Label

  `_on_click_text`(widget, event)

    event handling text edition

  `_on_entry_activated`(widget)

    get the text entered in gtk.Entry

  `_on_entry_buttonpress`(widget, event)

    handle button events in gtk.Entry.

  `_on_entry_keypress`(widget, event)

    handle keypressed in gtk.Entry

  `editing`()

    Return if we are currently editing

  `get_text`()

    get the text from the label

  `is_custom`()

    Return whether or not we have a custom string set

  `modify_fg`(state, color)

    Set the label foreground

  `modify_font`(fontdesc)

    Set the label font using a pango.FontDescription

  `set_angle`(angle)

    set angle of the label

  `set_custom`()

    Set the customness of the string to True

  `set_text`(text, force=False)

    set the text of the label

  `_autotext` = None
  `_custom` = None
  `_ebox` = None
  `_entry` = None
  `_entry_handler_id` = None
  `_label` = None

## terminatorlib.encoding module

TerminatorEncoding by Emmanuel Bretelle <chantra@debuntu.org>

TerminatorEncoding supplies a list of possible encoding
  values.
This list is taken from gnome-terminal’s src/terminal-encoding.c
  and src/encoding.c

class `terminatorlib.encoding.``TerminatorEncoding`

  Class to store encoding details

  `__init__`()
  static `get_list`()

    Return a list of supported encodings

  `encodings` = [[True, None, 'Current Locale'], [False, 'ISO-8859-1', 'Western'], [False, 'ISO-8859-2', 'Central European'], [False, 'ISO-8859-3', 'South European'], [False, 'ISO-8859-4', 'Baltic'], [False, 'ISO-8859-5', 'Cyrillic'], [False, 'ISO-8859-6', 'Arabic'], [False, 'ISO-8859-7', 'Greek'], [False, 'ISO-8859-8', 'Hebrew Visual'], [False, 'ISO-8859-8-I', 'Hebrew'], [False, 'ISO-8859-9', 'Turkish'], [False, 'ISO-8859-10', 'Nordic'], [False, 'ISO-8859-13', 'Baltic'], [False, 'ISO-8859-14', 'Celtic'], [False, 'ISO-8859-15', 'Western'], [False, 'ISO-8859-16', 'Romanian'], [False, 'UTF-8', 'Unicode'], [False, 'ARMSCII-8', 'Armenian'], [False, 'BIG5', 'Chinese Traditional'], [False, 'BIG5-HKSCS', 'Chinese Traditional'], [False, 'CP866', 'Cyrillic/Russian'], [False, 'EUC-JP', 'Japanese'], [False, 'EUC-KR', 'Korean'], [False, 'EUC-TW', 'Chinese Traditional'], [False, 'GB18030', 'Chinese Simplified'], [False, 'GB2312', 'Chinese Simplified'], [False, 'GBK', 'Chinese Simplified'], [False, 'GEORGIAN-PS', 'Georgian'], [False, 'HZ', 'Chinese Simplified'], [False, 'IBM850', 'Western'], [False, 'IBM852', 'Central European'], [False, 'IBM855', 'Cyrillic'], [False, 'IBM857', 'Turkish'], [False, 'IBM862', 'Hebrew'], [False, 'IBM864', 'Arabic'], [False, 'ISO-2022-JP', 'Japanese'], [False, 'ISO-2022-KR', 'Korean'], [False, 'ISO-IR-111', 'Cyrillic'], [False, 'KOI8-R', 'Cyrillic'], [False, 'KOI8-U', 'Cyrillic/Ukrainian'], [False, 'MAC_ARABIC', 'Arabic'], [False, 'MAC_CE', 'Central European'], [False, 'MAC_CROATIAN', 'Croatian'], [False, 'MAC-CYRILLIC', 'Cyrillic'], [False, 'MAC_DEVANAGARI', 'Hindi'], [False, 'MAC_FARSI', 'Persian'], [False, 'MAC_GREEK', 'Greek'], [False, 'MAC_GUJARATI', 'Gujarati'], [False, 'MAC_GURMUKHI', 'Gurmukhi'], [False, 'MAC_HEBREW', 'Hebrew'], [False, 'MAC_ICELANDIC', 'Icelandic'], [False, 'MAC_ROMAN', 'Western'], [False, 'MAC_ROMANIAN', 'Romanian'], [False, 'MAC_TURKISH', 'Turkish'], [False, 'MAC_UKRAINIAN', 'Cyrillic/Ukrainian'], [False, 'SHIFT-JIS', 'Japanese'], [False, 'TCVN', 'Vietnamese'], [False, 'TIS-620', 'Thai'], [False, 'UHC', 'Korean'], [False, 'VISCII', 'Vietnamese'], [False, 'WINDOWS-1250', 'Central European'], [False, 'WINDOWS-1251', 'Cyrillic'], [False, 'WINDOWS-1252', 'Western'], [False, 'WINDOWS-1253', 'Greek'], [False, 'WINDOWS-1254', 'Turkish'], [False, 'WINDOWS-1255', 'Hebrew'], [False, 'WINDOWS-1256', 'Arabic'], [False, 'WINDOWS-1257', 'Baltic'], [False, 'WINDOWS-1258', 'Vietnamese']]

## terminatorlib.factory module

factory.py - Maker of objects

    >>> maker = Factory()
    >>> window = maker.make_window()
    >>> maker.isinstance(window, 'Window')
    True
    >>> terminal = maker.make_terminal()
    >>> maker.isinstance(terminal, 'Terminal')
    True
    >>> hpaned = maker.make_hpaned()
    >>> maker.isinstance(hpaned, 'HPaned')
    True
    >>> vpaned = maker.make_vpaned()
    >>> maker.isinstance(vpaned, 'VPaned')
    True

class `terminatorlib.factory.``Factory`

  Bases: `terminatorlib.borg.Borg`

  Definition of a class that makes other classes

  `__init__`()

    Class initialiser

  `isinstance`(product, classtype)

    Check if a given product is a particular type of object

  `make`(product, **kwargs)

    Make the requested product

  `make_hpaned`(**kwargs)

    Make an HPaned

  `make_notebook`(**kwargs)

    Make a Notebook

  `make_terminal`(**kwargs)

    Make a Terminal

  `make_vpaned`(**kwargs)

    Make a VPaned

  `make_window`(**kwargs)

    Make a Window

  `prepare_attributes`()

    Required by the borg, but a no-op here

  `type`(product)

    Determine the type of an object we’ve previously created

  `instance_types` = {}
  `instance_types_keys` = []
  `types` = {'Container': 'container', 'VPaned': 'paned', 'Terminal': 'terminal', 'Window': 'window', 'Notebook': 'notebook', 'Paned': 'paned', 'HPaned': 'paned'}
  `types_keys` = ['Container', 'VPaned', 'Terminal', 'Window', 'Notebook', 'Paned', 'HPaned']

## terminatorlib.freebsd module

freebsd.get_process_cwd(pid):
  Use sysctl() to retrieve the cwd of an arbitrary process on FreeBSD using kern.proc.filedesc, as used by procstat(1). Tested on FreeBSD 7-STABLE/amd64 from April 11 2008.

class `terminatorlib.freebsd.``kinfo_file`

  Bases: `_ctypes.Structure`

  struct kinfo_file, defined in /usr/include/sys/user.h

  `_fields_` = [('kf_structsize', <class 'ctypes.c_long'>), ('kf_type', <class 'ctypes.c_long'>), ('kf_fd', <class 'ctypes.c_long'>), ('kf_ref_count', <class 'ctypes.c_long'>), ('kf_flags', <class 'ctypes.c_long'>), ('kf_offset', <class 'ctypes.c_ulong'>), ('kf_vnode_type', <class 'ctypes.c_long'>), ('kf_sock_domain', <class 'ctypes.c_long'>), ('kf_sock_type', <class 'ctypes.c_long'>), ('kf_sock_protocol', <class 'ctypes.c_long'>), ('kf_path', <class 'terminatorlib.freebsd.c_char_Array_1024'>), ('kf_sa_local', <class 'terminatorlib.freebsd.sockaddr_storage'>), ('kf_sa_peer', <class 'terminatorlib.freebsd.sockaddr_storage'>)]
  `kf_fd`

    Structure/Union member

  `kf_flags`

    Structure/Union member

  `kf_offset`

    Structure/Union member

  `kf_path`

    Structure/Union member

  `kf_ref_count`

    Structure/Union member

  `kf_sa_local`

    Structure/Union member

  `kf_sa_peer`

    Structure/Union member

  `kf_sock_domain`

    Structure/Union member

  `kf_sock_protocol`

    Structure/Union member

  `kf_sock_type`

    Structure/Union member

  `kf_structsize`

    Structure/Union member

  `kf_type`

    Structure/Union member

  `kf_vnode_type`

    Structure/Union member

class `terminatorlib.freebsd.``sockaddr_storage`

  Bases: `_ctypes.Structure`

  struct sockaddr_storage, defined in /usr/include/sys/socket.h

  `__ss_align`

    Structure/Union member

  `__ss_pad1`

    Structure/Union member

  `__ss_pad2`

    Structure/Union member

  `_fields_` = [('ss_len', <class 'ctypes.c_char'>), ('ss_family', <class 'ctypes.c_char'>), ('__ss_pad1', <class 'terminatorlib.freebsd.c_char_Array_6'>), ('__ss_align', <class 'ctypes.c_longlong'>), ('__ss_pad2', <class 'terminatorlib.freebsd.c_char_Array_112'>)]
  `ss_family`

    Structure/Union member

  `ss_len`

    Structure/Union member

`terminatorlib.freebsd.``get_process_cwd`(pid)

  Return string containing the current working directory of the given pid, or None on failure.

## terminatorlib.ipc module

ipc.py - DBus server and API calls

class `terminatorlib.ipc.``DBusService`

  Bases: `terminatorlib.borg.Borg`, `dbus.service.Object`

  DBus Server class. This is implemented as a Borg

  `__init__`()

    Class initialiser

  `get_terminal_tab`(uuid)

    Return the UUID of the parent tab of a given terminal

  `get_terminal_tab_title`(uuid)

    Return the title of a parent tab of a given terminal

  `get_terminals`(uuid)

    Return a list of all the terminals

  `new_tab`(options=dbus.Dictionary({}, signature=None))

    Create a new tab

  `new_window`(options=dbus.Dictionary({}, signature=None))

    Create a new Window

  `prepare_attributes`()

    Ensure we are populated

  `terminal_hsplit`(uuid=None)

    Split a terminal horizontally, by UUID

  `terminal_split`(uuid, horiz)

    Split a terminal horizontally or vertically, by UUID

  `terminal_vsplit`(uuid=None)

    Split a terminal vertically, by UUID

  `_dbus_class_table` = {'dbus.service.Interface': {}, 'dbus.service.FallbackObject': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Introspect at 0x43533534>}}, 'dbus.service.Object': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Introspect at 0x43533534>}}, 'terminatorlib.ipc.DBusService': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Introspect at 0x43533534>}, 'net.tenshu.Terminator_0x3bcad31e': {'get_terminal_tab': <function get_terminal_tab at 0x436f1144>, 'terminal_hsplit': <function terminal_hsplit at 0x436f1064>, 'terminal_vsplit': <function terminal_vsplit at 0x436f109c>, 'new_window': <function new_window at 0x43519fb4>, 'get_terminals': <function get_terminals at 0x436f110c>, 'new_tab': <function new_tab at 0x436f102c>, 'get_terminal_tab_title': <function get_terminal_tab_title at 0x436f117c>}}}
  `bus_name` = None
  `bus_path` = None
  `terminator` = None

`terminatorlib.ipc.``get_terminal_tab`(*args, **argd)

`terminatorlib.ipc.``get_terminal_tab_title`(*args, **argd)

`terminatorlib.ipc.``get_terminals`(*args, **argd)

`terminatorlib.ipc.``new_tab`(*args, **argd)

`terminatorlib.ipc.``new_window`(*args, **argd)

`terminatorlib.ipc.``terminal_hsplit`(*args, **argd)

`terminatorlib.ipc.``terminal_vsplit`(*args, **argd)

`terminatorlib.ipc.``with_proxy`(func)

  Decorator function to connect to the session dbus bus

## terminatorlib.keybindings module

Terminator by Chris Jones <cmsj@tenshu.net>

Validator and functions for dealing with Terminator’s customisable keyboard shortcuts.

exception `terminatorlib.keybindings.``KeymapError`

  Bases: `exceptions.Exception`

  Custom exception for errors in keybinding configurations

class `terminatorlib.keybindings.``Keybindings`

  Class to handle loading and lookup of Terminator keybindings

  `__init__`()
  `_lookup_modifier`(modifier)

    Map modifier names to gtk values

  `_parsebinding`(binding)

    Parse an individual binding using gtk’s binding function

  `configure`(bindings)

    Accept new bindings and reconfigure with them

  `lookup`(event)

    Translate a keyboard event into a mapped key

  `reload`()

    Parse bindings and mangle into an appropriate form

  `_lookup` = None
  `_masks` = None
  `empty` = {}
  `keys` = None
  `modifiers` = {'control': <flags GDK_CONTROL_MASK of type GdkModifierType>, 'ctrl': <flags GDK_CONTROL_MASK of type GdkModifierType>, 'shift': <flags GDK_SHIFT_MASK of type GdkModifierType>, 'primary': <flags GDK_CONTROL_MASK of type GdkModifierType>, 'alt': <flags GDK_MOD1_MASK of type GdkModifierType>, 'super': <flags GDK_SUPER_MASK of type GdkModifierType>}

## terminatorlib.layoutlauncher module

layoutlauncher.py - class for the Layout Launcher window

class `terminatorlib.layoutlauncher.``LayoutLauncher`

  Class implementing the various parts of the preferences editor

  `__init__`()
  `launch_layout`()

    Launch the selected layout as new instance

  `on_destroy_event`(widget, data=None)

    Handle window destruction

  `on_launchbutton_clicked`(widget)

    Handle button click

  `on_row_activated`(widget, path, view_column)

    Handle item double-click and return

  `update_layouts`()

    Update the contents of the layout

  `builder` = None
  `config` = None
  `keybindings` = None
  `layouttreestore` = None
  `layouttreeview` = None
  `plugins` = None
  `registry` = None
  `terminator` = None
  `window` = None

## terminatorlib.notebook module

notebook.py - classes for the notebook widget

class `terminatorlib.notebook.``Notebook`(window)

  Bases: `terminatorlib.container.Container`, `gtk.Notebook`

  Class implementing a gtk.Notebook container

  `__init__`(window)

    Class initialiser

  `add`(widget, metadata=None)

    Add a widget to the container

  `clean_last_active_term`()

    Clean up old entries in last_active_term

  `closetab`(widget, label)

    Close a tab

  `configure`()

    Apply widget-wide settings

  `create_layout`(layout)

    Apply layout configuration

  `deferred_on_tab_switch`(notebook, page, page_num, data=None)

    Prime a single idle tab switch signal, using the most recent set of params

  `do_deferred_on_tab_switch`()

    Perform the latest tab switch signal, and resetting the pending flag

  `find_tab_root`(widget)

    Look for the tab child which is or ultimately contains the supplied widget

  `get_child_metadata`(widget)

    Fetch the relevant metadata for a widget which we’d need to recreate it when it’s readded

  `get_children`()

    Return an ordered list of our children

  `hoover`()

    Clean up any empty tabs and if we only have one tab left, die

  `newtab`(debugtab=False, widget=None, cwd=None, metadata=None, profile=None)

    Add a new tab, optionally supplying a child widget

  `on_tab_switch`(notebook, page, page_num, data=None)

    Do the real work for a tab switch

  `page_num_descendant`(widget)

    Find the tabnum of the tab containing a widget at any level

  `remove`(widget)

    Remove a widget from the container

  `replace`(oldwidget, newwidget)

    Replace a tab’s contents with a new widget

  `resizeterm`(widget, keyname)

    Handle a keyboard event requesting a terminal resize

  `set_last_active_term`(uuid)

    Set the last active term for uuid

  `split_axis`(widget, vertical=True, cwd=None, sibling=None, widgetfirst=True)

    Split the axis of a terminal inside us

  `unzoom`(widget)

    Unzoom a terminal

  `update_tab_label_text`(widget, text)

    Update the text of a tab label

  `wrapcloseterm`(widget)

    A child terminal has closed

  `zoom`(widget, fontscale=False)

    Zoom a terminal

  `last_active_term` = None
  `pending_on_tab_switch` = None
  `pending_on_tab_switch_args` = None
  `window` = None

class `terminatorlib.notebook.``TabLabel`(title, notebook)

  Bases: `gtk.HBox`

  Class implementing a label widget for Notebook tabs

  `__init__`(title, notebook)

    Class initialiser

  `get_custom_label`()

    Return a custom label if we have one, otherwise None

  `get_label`()
  `on_close`(_widget)

    The close button has been clicked. Destroy the tab

  `set_custom_label`(text)

    Set a permanent label as if the user had edited it

  `set_label`(text)

    Update the text of our label

  `update_angle`()

    Update the angle of a label

  `update_button`()

    Update the state of our close button

  `button` = None
  `config` = None
  `icon` = None
  `label` = None
  `notebook` = None
  `terminator` = None

## terminatorlib.optionparse module

Terminator.optionparse - Parse commandline options

`terminatorlib.optionparse.``execute_cb`(option, opt, value, lparser)

  Callback for use in parsing execute options

`terminatorlib.optionparse.``parse_options`()

  Parse the command line options

## terminatorlib.paned module

paned.py - a base Paned container class and the vertical/horizontal variants

class `terminatorlib.paned.``HPaned`

  Bases: `terminatorlib.paned.Paned`, `gtk.HPaned`

  Merge gtk.HPaned into our base Paned Container

  `__init__`()

    Class initialiser

  `get_length`()
  `set_pos`(pos)

class `terminatorlib.paned.``Paned`

  Bases: `terminatorlib.container.Container`

  Base class for Paned Containers

  `__init__`()

    Class initialiser

  `_do_redistribute`(recurse_up=False, recurse_down=False)
  `add`(widget, metadata=None)

    Add a widget to the container

  `create_layout`(layout)

    Apply layout configuration

  `do_redistribute`(recurse_up=False, recurse_down=False)

    Evenly divide available space between sibling panes

  `get_child_metadata`(widget)

    Return metadata about a child

  `get_children`()

    Return an ordered list of our children

  `grab_focus`()

    We don’t want focus, we want a Terminal to have it

  `hoover`()

    Check that we still have a reason to exist

  `new_size`(widget, allocation)
  `on_button_press`(widget, event)

    Handle button presses on a Pane

  `remove`(widget)

    Remove a widget from the container

  `resizeterm`(widget, keyname)

    Handle a keyboard event requesting a terminal resize

  `rotate`(widget, clockwise)

    Default rotation. This should be implemented by subclasses

  `set_position`(pos)
  `set_position_by_ratio`()
  `split_axis`(widget, vertical=True, cwd=None, sibling=None, widgetfirst=True)

    Default axis splitter. This should be implemented by subclasses

  `wrapcloseterm`(widget)

    A child terminal has closed, so this container must die

  `maker` = None
  `position` = None
  `ratio` = 0.5

class `terminatorlib.paned.``VPaned`

  Bases: `terminatorlib.paned.Paned`, `gtk.VPaned`

  Merge gtk.VPaned into our base Paned Container

  `__init__`()

    Class initialiser

  `get_length`()
  `set_pos`(pos)

## terminatorlib.plugin module

plugin.py - Base plugin system
  Inspired by Armin Ronacher’s post at http://lucumr.pocoo.org/2006/7/3/python-plugin-system Used with permission (the code in that post is to be considered BSD licenced, per the authors wishes)

    >>> registry = PluginRegistry()
    >>> registry.instances
    {}
    >>> registry.load_plugins(True)
    >>> plugins = registry.get_plugins_by_capability('test')
    >>> len(plugins)
    1
    >>> plugins[0]
    <testplugin.TestPlugin object at 0x...>
    >>> registry.get_plugins_by_capability('this_should_not_ever_exist')
    []
    >>> plugins[0].do_test()
    'TestPluginWin'

class `terminatorlib.plugin.``MenuItem`

  Bases: `terminatorlib.plugin.Plugin`

  Base class for menu items

  `callback`(menuitems, menu, terminal)

    Callback to transform the enclosed URL

  `capabilities` = ['terminal_menu']

class `terminatorlib.plugin.``Plugin`

  Bases: `object`

  Definition of our base plugin class

  `__init__`()

    Class initialiser.

  `unload`()

    Prepare to be unloaded

  `capabilities` = None

class `terminatorlib.plugin.``PluginRegistry`

  Bases: `terminatorlib.borg.Borg`

  Definition of a class to store plugin instances

  `__init__`()

    Class initialiser

  `disable`(plugin)

    Disable a plugin

  `enable`(plugin)

    Enable a plugin

  `get_all_plugins`()

    Return all plugins

  `get_available_plugins`()

    Return a list of all available plugins whether they are enabled or disabled

  `get_plugins_by_capability`(capability)

    Return a list of plugins with a particular capability

  `is_enabled`(plugin)

    Return a boolean value indicating whether a plugin is enabled or not

  `load_plugins`(testing=False)

    Load all plugins present in the plugins/ directory in our module

  `prepare_attributes`()

    Prepare our attributes

  `available_plugins` = None
  `done` = None
  `instances` = None
  `path` = None

class `terminatorlib.plugin.``URLHandler`

  Bases: `terminatorlib.plugin.Plugin`

  Base class for URL handlers

  `__init__`()

    Class initialiser

  `callback`(url)

    Callback to transform the enclosed URL

  `unload`()

    Handle being removed

  `capabilities` = ['url_handler']
  `handler_name` = None
  `match` = None
  `namecopy` = None
  `nameopen` = None

## terminatorlib.prefseditor module

Preferences Editor for Terminator.

Load a UIBuilder config file, display it, populate it with our current config, then optionally read that back out and write it to a config file

class `terminatorlib.prefseditor.``LayoutEditor`(builder)
  `__init__`(builder)

    Initialise ourself

  `on_layout_item_selection_changed`(selection)

    A different item in the layout was selected

  `on_layout_profile_chooser_changed`(widget)

    A new profile has been selected for this item

  `on_layout_profile_command_activate`(widget)

    A new command has been entered for this item

  `on_layout_profile_workingdir_activate`(widget)

    A new working directory has been entered for this item

  `on_layout_selection_changed`(selection)

    A different layout was selected

  `prepare`(layout=None)

    Do the things we can’t do in __init__

  `set_layout`(layout_name)

    Load a particular layout

  `set_layout_item`(item_name)

    Set a layout item

  `update_profiles`()

    Update the list of profiles

  `builder` = None
  `config` = None
  `layout_item` = None
  `layout_name` = None
  `profile_ids_to_profile` = None
  `profile_profile_to_ids` = None
  `treestore` = None
  `treeview` = None

class `terminatorlib.prefseditor.``PrefsEditor`(term)

  Class implementing the various parts of the preferences editor

  `__init__`(term)
  `on_allow_bold_checkbutton_toggled`(widget)

    Allow bold setting changed

  `on_alternate_screen_scroll_checkbutton_toggled`(widget)

    Scroll in alt-mode setting changed

  `on_always_split_with_profile_toggled`(widget)

    Always split with profile setting changed

  `on_alwaysontopcheck_toggled`(widget)

    Always on top setting changed

  `on_antialias_checkbutton_toggled`(widget)

    Anti-alias setting changed

  `on_audible_bell_checkbutton_toggled`(widget)

    Audible bell setting changed

  `on_background_colorpicker_color_set`(widget)

    Background color changed

  `on_background_image_filechooser_file_set`(widget)

    Background image setting changed

  `on_background_type_toggled`(_widget)

    The background type was toggled

  `on_backspace_binding_combobox_changed`(widget)

    Backspace binding setting changed

  `on_broadcastdefault_changed`(widget)

    Broadcast default changed

  `on_cellrenderer_accel_cleared`(liststore, path)

    Handle the clearing of a keybinding accelerator

  `on_cellrenderer_accel_edited`(liststore, path, key, mods, _code)

    Handle an edited keybinding

  `on_closebutton_clicked`(_button)

    Close the window

  `on_color_scheme_combobox_changed`(widget)

    Update the fore/background colour pickers

  `on_copy_on_selection_toggled`(widget)

    Copy on selection setting changed

  `on_cursor_blink_toggled`(widget)

    Cursor blink setting changed

  `on_cursor_color_color_set`(widget)

    Cursor colour changed

  `on_cursor_shape_combobox_changed`(widget)

    Cursor shape changed

  `on_custom_command_entry_changed`(widget)

    Custom command value changed

  `on_custom_url_handler_entry_changed`(widget)

    Custom URL handler value changed

  `on_darken_background_scale_change_value`(widget, scroll, value)

    Background darkness setting changed

  `on_dbuscheck_toggled`(widget)

    DBus server setting changed

  `on_delete_binding_combobox_changed`(widget)

    Delete binding setting changed

  `on_encoding_combobox_changed`(widget)

    Encoding setting changed

  `on_exit_action_combobox_changed`(widget)

    Exit action changed

  `on_focuscombo_changed`(widget)

    Focus type changed

  `on_font_selector_font_set`(widget)

    Font changed

  `on_foreground_colorpicker_color_set`(widget)

    Foreground color changed

  `on_handlesize_change_value`(widget, scroll, value)

    Handle size changed

  `on_hidefromtaskbcheck_toggled`(widget)

    Hide from taskbar setting changed

  `on_hideonlosefocuscheck_toggled`(widget)

    Hide on lose focus setting changed

  `on_homogeneous_toggled`(widget)

    homogeneous_tabbar setting changed

  `on_icon_bell_checkbutton_toggled`(widget)

    Icon bell setting changed

  `on_inactive_color_offset_change_value`(widget, scroll, value)

    Inactive color offset setting changed

  `on_layout_item_selection_changed`(selection)

    A different item in the layout was selected

  `on_layout_name_edited`(cell, path, newtext)

    Update a layout name

  `on_layout_profile_chooser_changed`(widget)

    A different profile has been selected for this item

  `on_layout_profile_command_changed`(widget)

    A different command has been entered for this item

  `on_layout_profile_workingdir_changed`(widget)

    A different working directory has been entered for this item

  `on_layout_selection_changed`(selection)

    A different layout was selected

  `on_layoutaddbutton_clicked`(_button)

    Add a new layout to the list

  `on_layoutrefreshbutton_clicked`(_button)

    Refresh the terminals status and update

  `on_layoutremovebutton_clicked`(_button)

    Remove a layout from the list

  `on_login_shell_checkbutton_toggled`(widget)

    Login shell setting changed

  `on_open_manual`(widget)

    Open the fine manual

  `on_palette_colorpicker_color_set`(widget)

    A palette colour changed

  `on_palette_combobox_changed`(widget)

    Palette selector changed

  `on_plugin_selection_changed`(selection)

    A different plugin was selected

  `on_plugin_toggled`(cell, path)

    A plugin has been enabled or disabled

  `on_profile_name_edited`(cell, path, newtext)

    Update a profile name

  `on_profile_selection_changed`(selection)

    A different profile was selected

  `on_profileaddbutton_clicked`(_button)

    Add a new profile to the list

  `on_profileremovebutton_clicked`(_button)

    Remove a profile from the list

  `on_reset_compatibility_clicked`(widget)

    Reset the confusing and annoying backspace/delete options to the safest values

  `on_scroll_background_checkbutton_toggled`(widget)

    Scroll background setting changed

  `on_scroll_on_keystroke_checkbutton_toggled`(widget)

    Scroll on keystrong setting changed

  `on_scroll_on_output_checkbutton_toggled`(widget)

    Scroll on output setting changed

  `on_scroll_toggled`(widget)

    scroll_tabbar setting changed

  `on_scrollback_infinite_toggled`(widget)

    Scrollback infiniteness changed

  `on_scrollback_lines_spinbutton_value_changed`(widget)

    Scrollback lines setting changed

  `on_scrollbar_position_combobox_changed`(widget)

    Scrollbar position setting changed

  `on_show_titlebar_toggled`(widget)

    Show titlebar setting changed

  `on_stickycheck_toggled`(widget)

    Sticky setting changed

  `on_system_font_checkbutton_toggled`(checkbox)

    Toggling the use_system_font checkbox needs to alter the sensitivity of the font selector

  `on_tabposcombo_changed`(widget)

    Tab position changed

  `on_title_font_selector_font_set`(widget)

    Titlebar Font changed

  `on_title_hide_sizetextcheck_toggled`(widget)

    Window geometry setting changed

  `on_title_inactive_bg_color_color_set`(widget)

    Title inactive background colour changed

  `on_title_inactive_fg_color_color_set`(widget)

    Title inactive foreground colour changed

  `on_title_receive_bg_color_color_set`(widget)

    Title receive background colour changed

  `on_title_receive_fg_color_color_set`(widget)

    Title receive foreground colour changed

  `on_title_system_font_checkbutton_toggled`(checkbox)

    Toggling the title_use_system_font checkbox needs to alter the sensitivity of the font selector

  `on_title_transmit_bg_color_color_set`(widget)

    Title transmit backgruond colour changed

  `on_title_transmit_fg_color_color_set`(widget)

    Title transmit foreground colour changed

  `on_update_records_checkbutton_toggled`(widget)

    Update records setting changed

  `on_urgent_bell_checkbutton_toggled`(widget)

    Window manager bell setting changed

  `on_use_custom_command_checkbutton_toggled`(checkbox)

    Toggling the use_custom_command checkbox needs to alter the sensitivity of the custom_command entrybox

  `on_use_custom_url_handler_checkbutton_toggled`(checkbox)

    Toggling the use_custom_url_handler checkbox needs to alter the sensitivity of the custom_url_handler entrybox

  `on_use_theme_colors_checkbutton_toggled`(widget)

    Update colour pickers

  `on_visual_bell_checkbutton_toggled`(widget)

    Visual bell setting changed

  `on_winbordercheck_toggled`(widget)

    Window border setting changed

  `on_wingeomcheck_toggled`(widget)

    Window geometry setting changed

  `on_winstatecombo_changed`(widget)

    Window state changed

  `on_word_chars_entry_changed`(widget)

    Word characters changed

  `set_layout`(layout_name)

    Set a layout

  `set_plugin`(plugin)

    Show the preferences for the selected plugin, if any

  `set_profile_values`(profile)

    Update the profile values for a given profile

  `set_values`()

    Update the preferences window with all the configuration from Config()

  `update_background_tab`()

    Update the background tab

  `builder` = None
  `colorschemevalues` = {'green_on_black': 3, 'solarized_light': 7, 'custom': 9, 'black_on_yellow': 0, 'ambience': 6, 'solarized_dark': 8, 'white_on_black': 4, 'orange_on_black': 5, 'grey_on_black': 2, 'black_on_white': 1}
  `colourschemes` = {'green_on_black': ['#00ff00', '#000000'], 'solarized_light': ['#657b83', '#fdf6e3'], 'black_on_yellow': ['#000000', '#ffffdd'], 'ambience': ['#ffffff', '#300a24'], 'solarized_dark': ['#839496', '#002b36'], 'white_on_black': ['#ffffff', '#000000'], 'orange_on_black': ['#e53c00', '#000000'], 'grey_on_black': ['#aaaaaa', '#000000'], 'black_on_white': ['#000000', '#ffffff']}
  `config` = None
  `keybindingnames` = {'cycle_prev': 'Focus the previous terminal', 'next_tab': 'Switch to the next tab', 'help': 'Open the manual', 'close_window': 'Close window', 'switch_to_tab_10': 'Switch to the tenth tab', 'resize_left': 'Resize the terminal left', 'full_screen': 'Toggle fullscreen', 'line_down': 'Scroll downwards one line', 'previous_profile': 'Switch to previous profile', 'rotate_ccw': 'Rotate terminals counter-clockwise', 'move_tab_left': 'Move the tab left', 'go_right': 'Focus the terminal right', 'go_left': 'Focus the terminal left', 'line_up': 'Scroll upwards one line', 'resize_right': 'Resize the terminal right', 'resize_down': 'Resize the terminal down', 'toggle_zoom': 'Maximise terminal', 'scaled_zoom': 'Zoom terminal', 'group_all_toggle': 'Group/Ungroup all terminals', 'page_down_half': 'Scroll downwards half a page', 'zoom_in': 'Increase font size', 'hide_window': 'Toggle window visibility', 'move_tab_right': 'Move the tab right', 'prev_tab': 'Switch to the previous tab', 'switch_to_tab_6': 'Switch to the sixth tab', 'switch_to_tab_7': 'Switch to the seventh tab', 'switch_to_tab_4': 'Switch to the fourth tab', 'switch_to_tab_5': 'Switch to the fifth tab', 'cycle_next': 'Focus the next terminal', 'switch_to_tab_3': 'Switch to the third tab', 'broadcast_off': "Don't broadcast key presses", 'switch_to_tab_1': 'Switch to the first tab', 'split_vert': 'Split vertically', 'group_tab': 'Group terminals in tab', 'switch_to_tab_8': 'Switch to the eighth tab', 'switch_to_tab_9': 'Switch to the ninth tab', 'page_down': 'Scroll downwards one page', 'insert_number': 'Insert terminal number', 'insert_padded': 'Insert padded terminal number', 'next_profile': 'Switch to next profile', 'zoom_out': 'Decrease font size', 'ungroup_all': 'Ungroup all terminals', 'broadcast_group': 'Broadcast key presses to group', 'switch_to_tab_2': 'Switch to the second tab', 'page_up': 'Scroll upwards one page', 'go_prev': 'Focus the previous terminal', 'layout_launcher': 'Open layout launcher window', 'group_tab_toggle': 'Group/Ungroup terminals in tab', 'page_up_half': 'Scroll upwards half a page', 'close_term': 'Close terminal', 'new_terminator': 'Spawn a new Terminator process', 'ungroup_tab': 'Ungroup terminals in tab', 'new_tab': 'Create a new tab', 'copy': 'Copy selected text', 'paste': 'Paste clipboard', 'reset': 'Reset the terminal', 'broadcast_all': 'Broadcast key events to all', 'search': 'Search terminal scrollback', 'go_up': 'Focus the terminal above', 'resize_up': 'Resize the terminal up', 'rotate_cw': 'Rotate terminals clockwise', 'split_horiz': 'Split horizontally', 'zoom_normal': 'Restore original font size', 'go_down': 'Focus the terminal below', 'new_window': 'Create a new window', 'edit_window_title': 'Edit window title', 'group_all': 'Group all terminals', 'go_next': 'Focus the next terminal', 'reset_clear': 'Reset and clear the terminal', 'toggle_scrollbar': 'Show/Hide the scrollbar'}
  `keybindings` = None
  `layouteditor` = None
  `palettes` = {'rxvt': '#000000:#cd0000:#00cd00:#cdcd00:#0000cd:#cd00cd:#00cdcd:#faebd7:#404040:#ff0000:#00ff00:#ffff00:#0000ff:#ff00ff:#00ffff:#ffffff', 'xterm': '#000000:#cd0000:#00cd00:#cdcd00:#0000ee:#cd00cd:#00cdcd:#e5e5e5:#7f7f7f:#ff0000:#00ff00:#ffff00:#5c5cff:#ff00ff:#00ffff:#ffffff', 'tango': '#000000:#cc0000:#4e9a06:#c4a000:#3465a4:#75507b:#06989a:#d3d7cf:#555753:#ef2929:#8ae234:#fce94f:#729fcf:#ad7fa8:#34e2e2:#eeeeec', 'linux': '#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff', 'ambience': '#2e3436:#cc0000:#4e9a06:#c4a000:#3465a4:#75507b:#06989a:#d3d7cf:#555753:#ef2929:#8ae234:#fce94f:#729fcf:#ad7fa8:#34e2e2:#eeeeec', 'solarized': '#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3'}
  `palettevalues` = {'rxvt': 3, 'xterm': 2, 'tango': 0, 'custom': 6, 'linux': 1, 'ambience': 4, 'solarized': 5}
  `plugins` = None
  `previous_layout_selection` = None
  `previous_profile_selection` = None
  `registry` = None
  `window` = None

`terminatorlib.prefseditor.``color2hex`(widget)

  Pull the colour values out of a Gtk ColorPicker widget and return them as 8bit hex values, sinces its default behaviour is to give 16bit values

## terminatorlib.searchbar module

searchbar.py - classes necessary to provide a terminal search bar

class `terminatorlib.searchbar.``Searchbar`

  Bases: `gtk.HBox`

  Class implementing the Searchbar widget

  `__init__`()

    Class initialiser

  `do_search`(widget)

    Trap and re-emit the clicked signal

  `end_search`(widget=None)

    Trap and re-emit the end-search signal

  `get_search_term`()

    Return the currently set search term

  `get_vte`()

    Find our parent widget

  `get_vte_buffer_range`()

    Get the range of a vte widget

  `next_search`(widget)

    Search forwards and jump to the next result, if any

  `prev_search`(widget)

    Jump back to the previous search

  `search_character`(widget, col, row, junk)

    We have to have a callback for each character

  `search_hit`(row)

    Update the UI for a search hit

  `search_keypress`(widget, event)

    Handle keypress events

  `start_search`()

    Show ourselves

  `wrap_toggled`(toggled)
  `config` = None
  `entry` = None
  `next` = None
  `prev` = None
  `reslabel` = None
  `searchits` = None
  `searchre` = None
  `searchrow` = None
  `searchstring` = None
  `vte` = None
  `wrap` = None

## terminatorlib.signalman module

Simple management of Gtk Widget signal handlers

class `terminatorlib.signalman.``Signalman`

  Bases: `object`

  Class providing glib signal tracking and management

  `__del__`()

    Class destructor. This is only used to check for stray signals

  `__init__`()

    Class initialiser

  `new`(widget, signal, handler, *args)

    Register a new signal on a widget

  `remove_all`()

    Remove all signal handlers for all widgets

  `remove_signal`(widget, signal)

    Remove a signal handler

  `remove_widget`(widget)

    Remove all signal handlers for a widget

  `cnxids` = None

## terminatorlib.terminal module

terminal.py - classes necessary to provide Terminal widgets

class `terminatorlib.terminal.``Terminal`

  Bases: `gtk.VBox`

  Class implementing the VTE widget and its wrappings

  `__init__`()

    Class initialiser

  `check_for_url`(event)

    Check if the mouse is over a URL

  `close`()

    Close ourselves

  `connect_signals`()

    Connect all the gtk signals and drag-n-drop mechanics

  `create_group`(_item)

    Trigger the creation of a group via the titlebar (because popup windows are really lame)

  `create_layout`(layout)

    Apply our layout

  `create_popup_group_menu`(widget, event=None)

    Pop up a menu for the group widget

  `create_terminalbox`()

    Create a GtkHBox containing the terminal and a scrollbar

  `deferred_on_vte_size_allocate`(widget, allocation)
  `describe_layout`(count, parent, global_layout, child_order)

    Describe our layout

  `do_autocleangroups_toggle`()

    Toggle the autocleangroups mode

  `do_deferred_on_vte_size_allocate`(widget, allocation)
  `do_scrollbar_toggle`()

    Show or hide the terminal scrollbar

  `do_splittogroup_toggle`()

    Toggle the splittogroup mode

  `ensure_visible_and_focussed`()

    Make sure that we’re visible and focussed

  `feed`(text)

    Feed the supplied text to VTE

  `force_set_profile`(widget, profile)

    Forcibly set our profile

  `get_cursor_position`()

    Return the co-ordinates of our cursor

  `get_cwd`()

    Return our cwd

  `get_font_size`()

    Return the width/height of our font

  `get_location`(term, x, y)

    Get our location within the terminal

  `get_profile`()

    Return our profile name

  `get_size`()

    Return the column/rows of the terminal

  `get_vte`()

    This simply returns the vte widget we are using

  `get_window_title`()

    Return the window title

  `get_zoom_data`()

    Return a dict of information for Window

  `grab_focus`()

    Steal focus for this terminal

  `is_zoomed`()

    Determine if we are a zoomed terminal

  `key_broadcast_all`()
  `key_broadcast_group`()
  `key_broadcast_off`()
  `key_close_term`()
  `key_copy`()
  `key_cycle_next`()
  `key_cycle_prev`()
  `key_edit_window_title`()
  `key_go_down`()
  `key_go_left`()
  `key_go_next`()
  `key_go_prev`()
  `key_go_right`()
  `key_go_up`()
  `key_group_all`()
  `key_group_all_toggle`()
  `key_group_tab`()
  `key_group_tab_toggle`()
  `key_help`()
  `key_insert_number`()
  `key_insert_padded`()
  `key_layout_launcher`()
  `key_line_down`()
  `key_line_up`()
  `key_move_tab_left`()
  `key_move_tab_right`()
  `key_new_terminator`()
  `key_new_window`()
  `key_next_profile`()
  `key_next_tab`()
  `key_page_down`()
  `key_page_down_half`()
  `key_page_up`()
  `key_page_up_half`()
  `key_paste`()
  `key_prev_tab`()
  `key_previous_profile`()
  `key_reset`()
  `key_reset_clear`()
  `key_resize_down`()
  `key_resize_left`()
  `key_resize_right`()
  `key_resize_up`()
  `key_rotate_ccw`()
  `key_rotate_cw`()
  `key_scaled_zoom`()
  `key_search`()
  `key_split_horiz`()
  `key_split_vert`()
  `key_switch_to_tab_1`()
  `key_switch_to_tab_10`()
  `key_switch_to_tab_2`()
  `key_switch_to_tab_3`()
  `key_switch_to_tab_4`()
  `key_switch_to_tab_5`()
  `key_switch_to_tab_6`()
  `key_switch_to_tab_7`()
  `key_switch_to_tab_8`()
  `key_switch_to_tab_9`()
  `key_toggle_scrollbar`()
  `key_toggle_zoom`()
  `key_ungroup_all`()
  `key_ungroup_tab`()
  `key_zoom_in`()
  `key_zoom_normal`()
  `key_zoom_out`()
  `match_add`(name, match)

    Register a URL match

  `match_remove`(name)

    Remove a previously registered URL match

  `maximise`(widget=None)

    Maximise ourself to fill the window

  `on_beep`(widget)

    Set the urgency hint for our window

  `on_buttonpress`(widget, event)

    Handler for mouse events

  `on_drag_begin`(widget, drag_context, _data)

    Handle the start of a drag event

  `on_drag_data_get`(_widget, _drag_context, selection_data, info, _time, data)

    I have no idea what this does, drag and drop is a mystery. sorry.

  `on_drag_data_received`(widget, drag_context, x, y, selection_data, _info, _time, data)

    Something has been dragged into the terminal. Handle it as either a URL or another terminal.

  `on_drag_motion`(widget, drag_context, x, y, _time, _data)

    shrug

  `on_edit_done`(_widget)

    A child widget is done editing a label, return focus to VTE

  `on_encoding_change`(_widget, encoding)

    Handle the encoding changing

  `on_expose_event`(widget, _event)

    Handle an expose event while dragging

  `on_group_button_press`(widget, event)

    Handler for the group button

  `on_keypress`(widget, event)

    Handler for keyboard events

  `on_mousewheel`(widget, event)

    Handler for modifier + mouse wheel scroll events

  `on_search_done`(_widget)

    We’ve finished searching, so clean up

  `on_vte_focus`(_widget)

    Update our UI when we get focus

  `on_vte_focus_in`(_widget, _event)

    Inform other parts of the application when focus is received

  `on_vte_focus_out`(_widget, _event)

    Inform other parts of the application when focus is lost

  `on_vte_notify_enter`(term, event)

    Handle the mouse entering this terminal

  `on_vte_size_allocate`(widget, allocation)
  `on_window_focus_out`()

    Update our UI when the window loses focus

  `open_url`(url, prepare=False)

    Open a given URL, conditionally unpacking it from a VTE match

  `paste_clipboard`(primary=False)

    Paste one of the two clipboards

  `populate_group_menu`()

    Fill out a group menu

  `popup_menu`(widget, event=None)

    Display the context menu

  `position_popup_group_menu`(menu, widget)

    Calculate the position of the group popup menu

  `prepare_url`(urlmatch)

    Prepare a URL from a VTE match

  `really_create_group`(_widget, groupname)

    The titlebar has spoken, let a group be created

  `reconfigure`(_widget=None)

    Reconfigure our settings

  `scroll_by`(amount)

    Scroll up or down by an amount of lines

  `scroll_by_line`(lines)

    Scroll up or down in lines

  `scroll_by_page`(pages)

    Scroll up or down in pages

  `scrollbar_jump`(position)

    Move the scrollbar to a particular row

  `set_cursor_color`()

    Set the cursor color appropriately

  `set_cwd`(cwd=None)

    Set our cwd

  `set_font`(fontdesc)

    Set the font we want in VTE

  `set_group`(_item, name)

    Set a particular group

  `set_groupsend`(_widget, value)

    Set the groupsend mode

  `set_profile`(_widget, profile, force=False)

    Set our profile

  `spawn_child`(widget=None, respawn=False, debugserver=False)
  `switch_to_next_profile`()
  `switch_to_previous_profile`()
  `toggle_widget_visibility`(widget)

    Show or hide a widget

  `ungroup`(_widget, data)

    Remove a group

  `unzoom`(widget=None)

    Restore normal layout

  `update_url_matches`(posix=True)

    Update the regexps used to match URLs

  `zoom`(widget=None)

    Zoom ourself to fill the window

  `zoom_font`(zoom_in)

    Change the font size

  `zoom_in`()

    Increase the font size

  `zoom_orig`()

    Restore original font size

  `zoom_out`()

    Decrease the font size

  `zoom_scale`(widget, allocation, old_data)

    Scale our font correctly based on how big we are not vs before

  `TARGET_TYPE_VTE` = 8
  `bgcolor` = None
  `clipboard` = None
  `cnxids` = None
  `command` = None
  `composite_support` = None
  `config` = None
  `custom_encoding` = None
  `custom_font_size` = None
  `cwd` = None
  `default_encoding` = None
  `directory` = None
  `fgcolor_active` = None
  `fgcolor_inactive` = None
  `group` = None
  `layout_command` = None
  `matches` = None
  `origcwd` = None
  `palette_active` = None
  `palette_inactive` = None
  `pid` = None
  `scrollbar` = None
  `scrollbar_position` = None
  `searchbar` = None
  `targets_for_new_group` = None
  `terminalbox` = None
  `terminator` = None
  `titlebar` = None
  `vte` = None

## terminatorlib.terminal_popup_menu module

terminal_popup_menu.py - classes necessary to provide a terminal context menu

class `terminatorlib.terminal_popup_menu.``TerminalPopupMenu`(terminal)

  Bases: `object`

  Class implementing the Terminal context menu

  `__init__`(terminal)

    Class initialiser

  `add_encoding_items`(menu)

    Add the encoding list to the menu

  `show`(widget, event=None)

    Display the context menu

  `config` = None
  `terminal` = None
  `terminator` = None

## terminatorlib.terminator module

terminator.py - class for the master Terminator singleton

class `terminatorlib.terminator.``Terminator`

  Bases: `terminatorlib.borg.Borg`

  master object for the application

  `__init__`()

    Class initialiser

  `all_emit`(terminal, type, event)

    Emit to all terminals

  `attempt_gnome_client`()

    Attempt to find a GNOME Session to register with

  `closegroupedterms`(group)

    Close all terminals in a group

  `create_group`(name)

    Create a new group

  `create_layout`(layoutname)

    Create all the parts necessary to satisfy the specified layout

  `deregister_launcher_window`(window)

    de-register a launcher window widget

  `deregister_terminal`(terminal)

    De-register a terminal widget

  `deregister_window`(window)

    de-register a window widget

  `describe_layout`()

    Describe our current layout

  `die`(*args)

    Die at the hands of the session manager

  `do_enumerate`(widget, pad)

    Insert the number of each terminal in a group, into that terminal

  `find_terminal_by_uuid`(uuid)

    Search our terminals for one matching the supplied UUID

  `focus_changed`(widget)

    We just moved focus to a new terminal

  `focus_left`(widget)
  `get_focussed_terminal`()

    iterate over all the terminals to find which, if any, has focus

  `get_sibling_terms`(widget)
  `get_target_terms`(widget)

    Get the terminals we should currently be broadcasting to

  `get_windows`()

    Return a list of windows

  `group_emit`(terminal, group, type, event)

    Emit to each terminal in a group

  `group_hoover`()

    Clean out unused groups

  `layout_done`()

    Layout operations have finished, record that fact

  `new_window`(cwd=None)

    Create a window with a Terminal in it

  `prepare_attributes`()

    Initialise anything that isn’t already

  `reconfigure`()

    Update configuration for the whole application

  `register_launcher_window`(window)

    Register a new launcher window widget

  `register_terminal`(terminal)

    Register a new terminal widget

  `register_window`(window)

    Register a new window widget

  `save_yourself`(*args)

    Save as much state as possible for the session manager

  `set_dbus_data`(dbus_service)

    Store the DBus bus details, if they are available

  `set_origcwd`(cwd)

    Store the original cwd our process inherits

  `config` = None
  `dbus_name` = None
  `dbus_path` = None
  `debug_address` = None
  `doing_layout` = None
  `gnome_client` = None
  `groups` = None
  `groupsend` = None
  `groupsend_type` = {'off': 2, 'all': 0, 'group': 1}
  `keybindings` = None
  `last_active_window` = None
  `launcher_windows` = None
  `layoutname` = None
  `origcwd` = None
  `pid_cwd` = None
  `terminals` = None
  `windows` = None
  `windowtitle` = None

## terminatorlib.titlebar module

titlebar.py - classes necessary to provide a terminal title bar

class `terminatorlib.titlebar.``Titlebar`(terminal)

  Bases: `gtk.EventBox`

  Class implementing the Titlebar widget

  `__init__`(terminal)

    Class initialiser

  `connect_icon`(func)

    Connect the supplied function to clicking on the group icon

  `create_group`()

    Create a new group

  `editing`()

    Determine if we’re currently editing a group name or title

  `get_custom_string`()

    If we have a custom string set, return it, otherwise None

  `get_desired_visibility`()

    Returns True if the titlebar is supposed to be visible. False if not

  `groupentry_activate`(widget)

    Actually cause a group to be created

  `groupentry_cancel`(widget, event)

    Hide the group name entry

  `groupentry_keypress`(widget, event)

    Handle keypresses on the entry widget

  `icon_bell`()

    A bell signal requires we display our bell icon

  `icon_bell_hide`()

    Handle a timeout which means we now hide the bell icon

  `on_clicked`(widget, event)

    Handle a click on the label

  `on_edit_done`(widget)

    Re-emit an edit-done signal from an EditableLabel

  `set_custom_string`(string)

    Set a custom string

  `set_from_icon_name`(name, size=<enum GTK_ICON_SIZE_MENU of type GtkIconSize>)

    Set an icon for the group label

  `set_group_label`(name)

    Set the name of the group

  `set_terminal_title`(widget, title)

    Update the terminal title

  `update`(other=None)

    Update our contents

  `update_terminal_size`(width, height)

    Update the displayed terminal size

  `update_visibility`()

    Make the titlebar be visible or not

  `bellicon` = None
  `config` = None
  `ebox` = None
  `groupentry` = None
  `groupicon` = None
  `grouplabel` = None
  `label` = None
  `oldtitle` = None
  `sizetext` = None
  `terminal` = None
  `terminator` = None
  `termtext` = None

## terminatorlib.translation module

Terminator by Chris Jones <cmsj@tenshu.net>

## terminatorlib.util module

Terminator.util - misc utility functions

`terminatorlib.util.``dbg`(log='')

  Print a message if debugging is enabled

`terminatorlib.util.``dict_diff`(reference, working)

  Examine the values in the supplied working set and return a new dict that only contains those values which are different from those in the reference dictionary

      >>> a = {'foo': 'bar', 'baz': 'bjonk'}
      >>> b = {'foo': 'far', 'baz': 'bjonk'}
      >>> dict_diff(a, b)
      {'foo': 'far'}

`terminatorlib.util.``enumerate_descendants`(parent)

  Walk all our children and build up a list of containers and terminals

`terminatorlib.util.``err`(log='')

  Print an error message

`terminatorlib.util.``gerr`(message=None)

  Display a graphical error. This should only be used for serious errors as it will halt execution

`terminatorlib.util.``get_config_dir`()

  Expand all the messy nonsense for finding where ~/.config/terminator really is

`terminatorlib.util.``get_edge`(allocation, direction)

  Return the edge of the supplied allocation that we will care about for directional navigation

`terminatorlib.util.``get_nav_offset`(edge, allocation, direction)

  Work out how far edge is from a particular point on the allocation rectangle, in the given direction

`terminatorlib.util.``get_nav_possible`(edge, allocation, direction, p1, p2)

  Check if the supplied allocation is in the right direction of the supplied edge

`terminatorlib.util.``get_nav_tiebreak`(direction, cursor_x, cursor_y, rect)

  We have multiple candidate terminals. Pick the closest by cursor position

`terminatorlib.util.``has_ancestor`(widget, wtype)

  Walk up the family tree of widget to see if any ancestors are of type

`terminatorlib.util.``inject_uuid`(target)

  Inject a UUID into an existing object

`terminatorlib.util.``make_uuid`(str_uuid=None)

  Generate a UUID for an object

`terminatorlib.util.``manual_lookup`()

  Choose the manual to open based on LANGUAGE

`terminatorlib.util.``path_lookup`(command)

  Find a command in our path

`terminatorlib.util.``shell_lookup`()

  Find an appropriate shell for the user

`terminatorlib.util.``spawn_new_terminator`(cwd, args)

  Start a new terminator instance with the given arguments

`terminatorlib.util.``widget_pixbuf`(widget, maxsize=None)

  Generate a pixbuf of a widget

## terminatorlib.version module

TerminatorVersion by Chris Jones <cmsj@tenshu.net>

TerminatorVersion supplies our version number.

## terminatorlib.window module

window.py - class for the main Terminator window

class `terminatorlib.window.``Window`

  Bases: `terminatorlib.container.Container`, `gtk.Window`

  Class implementing a top-level Terminator window

  `__init__`()

    Class initialiser

  `add`(widget, metadata=None)

    Add a widget to the window by way of gtk.Window.add()

  `apply_config`()

    Apply various configuration options

  `apply_icon`(requested_icon)

    Set the window icon

  `closeterm`(widget)

    Handle a terminal closing

  `confirm_close`(window, type)

    Display a confirmation dialog when the user is closing multiple terminals in one window

  `create_layout`(layout)

    Apply any config items from our layout

  `deferred_set_rough_geometry_hints`()
  `do_deferred_set_rough_geometry_hints`()
  `do_get_property`(prop)

    Handle gobject getting a property

  `do_set_property`(prop, value)

    Handle gobject setting a property

  `get_children`()

    Return a single list of our child

  `get_focussed_terminal`()

    Find which terminal we want to have focus

  `get_visible_terminals`()

    Walk down the widget tree to find all of the visible terminals. Mostly using Container::get_visible_terminals()

  `group_all`(widget)

    Group all terminals

  `group_all_toggle`(widget)

    Toggle grouping to all

  `group_tab`(widget)

    Group all terminals in the current tab

  `group_tab_toggle`(widget)

    Blah

  `hoover`()

    Ensure we still have a reason to exist

  `is_child_notebook`()

    Returns True if this Window’s child is a Notebook

  `move_tab`(widget, direction)

    Handle a keyboard shortcut for moving tab positions

  `navigate_terminal`(terminal, direction)

    Navigate around terminals

  `on_button_press`(window, event)

    Handle a mouse button event. Mainly this is just a clean way to cancel any urgency hints that are set.

  `on_delete_event`(window, event, data=None)

    Handle a window close request

  `on_destroy_event`(widget, data=None)

    Handle window destruction

  `on_focus_in`(window, event)

    Focus has entered the window

  `on_focus_out`(window, event)

    Focus has left the window

  `on_hide_window`(data=None)

    Handle a request to hide/show the window

  `on_key_press`(window, event)

    Handle a keyboard event

  `on_window_state_changed`(window, event)

    Handle the state of the window changing

  `register_callbacks`()

    Connect the GTK+ signals we care about

  `remove`(widget)

    Remove our child widget by way of gtk.Window.remove()

  `rotate`(widget, clockwise)

    Rotate children in this window

  `set_always_on_top`(value)

    Set the always on top window hint from the supplied value

  `set_borderless`(value)

    Set the state of the window border from the supplied value

  `set_fullscreen`(value)

    Set the fullscreen state of the window from the supplied value

  `set_groups`(new_group, term_list)

    Set terminals in term_list to new_group

  `set_hidden`(value)

    Set the visibility of the window from the supplied value

  `set_iconified`(value)

    Set the minimised state of the window from the supplied value

  `set_maximised`(value)

    Set the maximised state of the window from the supplied value

  `set_real_transparency`(value=True)

    Enable RGBA if supported on the current screen

  `set_rough_geometry_hints`()

    Walk all the terminals along the top and left edges to fake up how many columns/rows we sort of have

  `set_sticky`(value)

    Set the sticky hint from the supplied value

  `show`(startup=False)

    Undo the startup show request if started in hidden mode

  `split_axis`(widget, vertical=True, cwd=None, sibling=None, widgetfirst=True)

    Split the window

  `tab_change`(widget, num=None)

    Change to a specific tab

  `tab_new`(widget=None, debugtab=False, _param1=None, _param2=None)

    Make a new tab

  `ungroup_all`(widget)

    Ungroup all terminals

  `ungroup_tab`(widget)

    Ungroup all terminals in the current tab

  `unzoom`(widget)

    Restore normal terminal layout

  `zoom`(widget, font_scale=True)

    Zoom a terminal widget

  `hidebound` = None
  `hidefunc` = None
  `ignore_startup_show` = None
  `isfullscreen` = None
  `ismaximised` = None
  `last_active_term` = None
  `losefocus_time` = 0
  `position` = None
  `set_pos_by_ratio` = None
  `term_zoomed` = False
  `terminator` = None
  `title` = None
  `zoom_data` = None

class `terminatorlib.window.``WindowTitle`(window)

  Bases: `object`

  Class to handle the setting of the window title

  `__init__`(window)

    Class initialiser

  `force_title`(newtext)

    Force a specific title

  `set_title`(widget, text)

    Set the title

  `update`()

    Update the title automatically

  `forced` = None
  `text` = None
  `window` = None

## Module contents

Terminator by Chris Jones <cmsj@tenshu.net>