usdmanager.parsers.log module¶
Log file parser
-
class
usdmanager.parsers.log.
LogParser
(parent=None)[source]¶ Bases:
usdmanager.parser.AbstractExtParser
Used for log files that may contain terminal color code characters.
-
compile
()[source]¶ Compile regular expression to find links based on the acceptable extensions stored in self.programs.
Override for language-specific RegEx.
NOTE: If this RegEx changes, the syntax highlighting rules may need to as well.
-
static
convertTeletype
(t)[source]¶ Convert teletype codes to HTML styles. This method assumes you have already escaped any necessary HTML characters.
Parameters: - t : str
Original text
Returns: String with teletype codes converted to HTML styles.
Rtype: str
-
exts
= ('log', 'txt')¶
-
htmlFormat
(text)[source]¶ Wrap the final text in a proper HTML document.
Override to add additional HTML tags only to the HTML representation of this file.
Parameters: text : str Returns: HTML text document Rtype: str
-
parseMatch
(match, linkPath, nativeAbsPath, fileInfo)[source]¶ Parse a RegEx match of a patch to another file.
Override for specific language parsing.
Parameters: - match
RegEx match object
- linkPath : str
Displayed file path matched by the RegEx
- nativeAbsPath : str
OS-native absolute file path for the file being parsed
- fileInfo : QFileInfo
File info object for the file being parsed
Returns: HTML link
Rtype: str
Raises ValueError: If path does not exist or cannot be resolved.
-