moler.events package

Submodules

moler.events.lineevent module

class moler.events.lineevent.LineEvent(detect_patterns, connection=None, till_occurs_times=-1, match='any', runner=None)

Bases: moler.events.textualevent.TextualEvent

compile_patterns(patterns)
get_long_desc()

Returns string with description of event.

Returns:String with description.
get_short_desc()

Returns string with description of event.

Returns:String with description.
on_new_line(line, is_full_line)

Method to parse output from device. Write your own implementation to do something useful :param line: Line to parse, new lines are trimmed :param is_full_line: True if new line character was removed from line, False otherwise :return: None

start(timeout=None, *args, **kwargs)

Start background execution of command.

moler.events.textualevent module

class moler.events.textualevent.TextualEvent(connection=None, till_occurs_times=-1, runner=None)

Bases: moler.event.Event

data_received(data, recv_time)

Called by framework when any data are sent by device.

Parameters:
  • data – List of strings sent by device.
  • recv_time – time stamp with the moment when the data was read from connection.
Returns:

None.

event_occurred(event_data)

Sets event_data as new item of occurrence ret. :param event_data: data to set as value of occurrence. :return: None

is_new_line(line)

Method to check if line has chars of new line at the right side :param line: String to check :return: True if any new line char was found, False otherwise

on_new_line(line, is_full_line)

Method to parse output from device. Write your own implementation to do something useful :param line: Line to parse, new lines are trimmed :param is_full_line: True if new line character was removed from line, False otherwise :return: None

pause()

Pauses the event. Do not process till resume.

Returns:None.
resume()

Resumes processing output from connection by the event.

Returns:None.

Module contents