flexget.components.irc.irc module#
- exception flexget.components.irc.irc.MissingConfigOption[source]#
Bases:
ExceptionException thrown when a config option specified in the tracker file is not on the irc config.
- exception flexget.components.irc.irc.TrackerFileError[source]#
Bases:
ExceptionException thrown when parsing the tracker file fails.
- exception flexget.components.irc.irc.TrackerFileParseError[source]#
Bases:
ExceptionException thrown when parsing the tracker file fails.
- class flexget.components.irc.irc.IRCConnection(config, config_name)[source]#
Bases:
object- classmethod read_tracker_config(path)[source]#
Attempt to open and parse the .tracker file specified in path.
- Parameters:
path – path to .tracker file
- Returns:
the parsed XML
- classmethod retrieve_tracker_config(tracker_config_file)[source]#
Attempt to retrieve the .tracker file from disk or github. Return the parsed XML.
- Parameters:
tracker_config_file – URL or path to .tracker file
- Returns:
parsed XML
- entries_from_linepatterns(lines)[source]#
Return list of entries generated from lines.
- Parameters:
lines – list of lines from irc
- Return type:
- entries_from_lines(lines)[source]#
Return list of entries generated from lines.
- Parameters:
lines – list of lines
- Return type:
- entries_from_multilinepatterns(lines)[source]#
Return list of entries generated from lines.
- Parameters:
lines – list of lines
- Return type:
- match_message_patterns(patterns, msg)[source]#
Try to match the message to the list of patterns. Support multiline messages.
- Parameters:
patterns – list of (regex, variable)-pairs
msg – The parsed IRC message
multiline – True if msg is multiline
- Returns:
A dict of the variables and their extracted values
- on_privmsg(msg)[source]#
Append messages for the specific channel in the line cache.
Schedule a message processing after 1s to handle multiline announcements. :param msg: IRCMessage object :return:
- parse_patterns(patterns)[source]#
Parse the patterns and create a tuple with the compiled regex pattern and the variables it produces.
- Parameters:
patterns – list of regex patterns as .tracker XML
- Returns:
list of (regex, variables, optional)-pairs
- process_message(nickname, channel)[source]#
Pop lines from the line cache and pass them to be parsed.
- process_tracker_config_rules(entry, rules=None)[source]#
Process an Entry object with the linematched rules defined in a tracker config file.
- Parameters:
entry – Entry to be updated
rules – Ruleset to use.
- Returns:
- class flexget.components.irc.irc.IRCConnectionManager(config)[source]#
Bases:
object- start()[source]#
Check for dead threads and attempt to restart them.
If the connection appears to be throttled, it won’t attempt to reconnect for 30s. :return:
- flexget.components.irc.irc.create_thread(name, conn)[source]#
Create a new thread and start it.
- Parameters:
conn – IRCConnection or IRCConnectionManager object
- Returns:
Thread