Table Of Contents

Previous topic

qslaunch

Next topic

qslaunch.utils

This Page

qslaunch.helpers

qslaunch.helpers.iterm

Provides helper functions for opening iTerm sessions.

Execute helpers

qslaunch.helpers.iterm.bookmark(name, where='window', cd=None)

itermlaunch.execute() helper for cmd_bookmark().

See cmd_bookmark() for usage.

qslaunch.helpers.iterm.shell_exec(command, where='window', title=None)

itermlaunch.execute() helper for cmd_exec().

See cmd_shell_exec() for usage.

Commands

qslaunch.helpers.iterm.cmd_bookmark(bookmark, where='window', cd=None)

Create a new iTerm session in a new window or tab and launch the specified session in it.

Parameters:
  • bookmark – bookmark name. It doesn’t exist, iTerm uses the default bookmark
  • where – string: either ‘window’ or ‘tab’
  • cd – string or callable

If where='tab' and there are no windows, a new one is created.

If the cd parameter is a callable, the return value must be a string.

qslaunch.helpers.iterm.cmd_exec(command, **kwargs)

Create a new iTerm session in a new window or tab and execute the specified shell commande inside.

Parameters:
  • command – shell command to execute
  • where – where to open the session (‘window’ or ‘tab’, default = ‘window’)
  • title – title to gove to the terminal

iTerm helpers

qslaunch.helpers.iterm.current_terminal_window()

Return the front most iTerm “terminal”.

If there are no windows, create a new one.

qslaunch.helpers.iterm.new_terminal_window()
Return a new, empty iTerm “terminal”.

qslaunch.helpers.mail

Provides helper functions for Mail.app.

Execute helpers

qslaunch.helpers.mail.color_selected_msgs(color='none')

qslaunch.execute() helper for cmd_color_selected_msgs().

See cmd_color_selected_msgs() for usage.

Commands

qslaunch.helpers.mail.cmd_color_selected_msgs(color)

Change the background color of the selected messages in Mail.app.

Parameter:color – color name. The list is restricted to: ‘blue’, ‘gray’, ‘green’, ‘none’, ‘orange’, ‘purple’, ‘red’, ‘yellow’

Example:

...
(r'^colormail-(?P<color>.*)$', mail.color_selected_msgs()),
...

qslaunch.helpers.textmate

Provide useful shortcuts for TextMate.

Execute helpers

qslaunch.helpers.textmate.new_from_template(*args)

Create a new TextMate window based on a specific template.

Parameter:args – The path to the template in the “File” menu. For example, new_from_template('Python', 'Python Script')
qslaunch.helpers.textmate.set_theme(theme=None)

Change TextMate’s theme.

Parameter:theme – Theme or None

Note

If “theme” is None, be sure to define a “theme” backreference in the ereg!

Commands

qslaunch.helpers.textmate.cmd_new_from_template(template_path)

Create a new TextMate window from a template.

Parameter:template_path – tuple/list representing the template.

The tuple is the menu items under “New From Template”.

Example:

cmd_new_from_template(('Python', 'Python Script'))
qslaunch.helpers.textmate.cmd_set_theme(theme)

Set the current theme using System Events.

Parameter:theme – Name of the theme