aeidon.agents.UtilityAgent¶
Source: aeidon/agents/util.py
Anchestors: aeidon.delegate.Delegate, builtins.object
- class aeidon.agents.UtilityAgent¶
 
Miscellaneous helper methods.
Methods¶
- UtilityAgent.get_all_indices()¶
 Return a list of all indices of subtitles.
- UtilityAgent.get_changed(doc)¶
 Return the changed value corresponding to doc.
- UtilityAgent.get_file(doc)¶
 Return the file corresponding to doc.
- UtilityAgent.get_format(doc)¶
 Return format of the file corresponding to doc.
For a translation file that is None, return format of main file. If main file is None, return None.
- UtilityAgent.get_liner(doc)¶
 Return a new aeidon.Liner instance.
- UtilityAgent.get_markup(doc)¶
 Return doc‘s markup instance or None.
- UtilityAgent.get_markup_clean_func(doc)¶
 Return the function to clean markup or None.
- UtilityAgent.get_markup_tag_regex(doc)¶
 Return the regular expression for a markup tag or None.
- UtilityAgent.get_mode()¶
 Return mode of the main file or default.
- UtilityAgent.get_parser(doc)¶
 Return a new aeidon.Parser instance.
- UtilityAgent.get_text_length(index, doc)¶
 Return the amount of characters in text excluding markup.
- UtilityAgent.get_text_signal(doc)¶
 Return the texts-changed signal corresponding to doc.
- UtilityAgent.new_subtitle()¶
 Return a new aeidon.Subtitle instance.
- UtilityAgent.new_temp_file(doc, encoding=None)¶
 Return path to a new temporary file with subtitles from doc.
Raise IOError if writing to temporary file fails. Raise UnicodeError if encoding temporary file fails.