Wrap the specified blob. Parameters: blob: The blob to wrap. as_path: Filter the contents of the blob as if it had the specified path. If `as_path` is None, the raw contents of the blob will be read. flags: A combination of
(
self,
blob: Blob,
as_path: Optional[str] = None,
flags: BlobFilter = BlobFilter.CHECK_FOR_BINARY,
commit_id: Optional[Oid] = None,
)
| 125 | """ |
| 126 | |
| 127 | def __init__( |
| 128 | self, |
| 129 | blob: Blob, |
| 130 | as_path: Optional[str] = None, |
| 131 | flags: BlobFilter = BlobFilter.CHECK_FOR_BINARY, |
| 132 | commit_id: Optional[Oid] = None, |
| 133 | ): |
| 134 | """Wrap the specified blob. |
| 135 | |
| 136 | Parameters: |
| 137 | blob: The blob to wrap. |
| 138 | as_path: Filter the contents of the blob as if it had the specified |
| 139 | path. If `as_path` is None, the raw contents of the blob will |
| 140 | be read. |
| 141 | flags: A combination of enums.BlobFilter constants |
| 142 | (only applicable when `as_path` is set). |
| 143 | commit_id: Commit to load attributes from when |
| 144 | ATTRIBUTES_FROM_COMMIT is specified in `flags` |
| 145 | (only applicable when `as_path` is set). |
| 146 | """ |
| 147 | raw = _BlobIO(blob, as_path=as_path, flags=flags, commit_id=commit_id) |
| 148 | super().__init__(raw) |
| 149 | |
| 150 | def __exit__(self, exc_type, exc_value, traceback): |
| 151 | self.close() |