Table Of Contents

Previous topic

API

Next topic

qslaunch.helpers

This Page

qslaunch

qslaunch

exception qslaunch.NoSuchCommand
Exception raised when command could not be found.
qslaunch.execute(name, patterns)

Execute a command by finding it in a list of patterns.

Parameters:
  • name – name to lookup in the pattern list
  • patterns – list of patterns

The list of patterns is a list of tuples, referenced here as “pattern”.

A “pattern” tuple has two items:

  1. regular expression to match
  2. command

The command is also a tuple, with three elements:

  1. the function to call
  2. positional arguments (tuple)
  3. named arguments (dict)

If the patterns contains named references (e.g. (?P<xx>yyy)), these will be also placed in the named arguments dictionary.

Example:

patterns = [
    (r'^x-(?P<tag>.*)$', (somefunc, (), {a=17})),
]
execute('x-abc', patterns)

Will call somefunc(a=17, tag='abc').

qslaunch.get_version(full=False)
Return version number.