fitzzftw.patch.lines.PatchLine¶
- class PatchLine[source]¶
Bases:
objectBase class for structural patch lines.
This class serves as the foundation for all specialized line types within a patch (e.g., HeadLine, FileLine). It handles the initial sanitization of the raw input stream.
Public Data Attributes:
The cleaned content of the line without trailing newlines (ro).
The original of the line without trailing newlines (ro).
has_trailing_whitespacePublic Methods:
__init__(raw_line)Initializes a PatchLine instance by sanitizing the input.
__repr__()Return repr(self).
Private Data Attributes:
_TRAIL_WS_RE_has_trailing_whitespace_content_orig_line
- __init__(raw_line)[source]¶
Initializes a PatchLine instance by sanitizing the input.
The raw line is stripped of trailing carriage returns and newlines. Additionally, it removes the specialized ‘No newline at end of file’ markers that can appear in Unified Diff format to ensure the content property contains only the actual text data.
- Parameters:
raw_line (str) – The unmodified string read directly from the patch source.