MCPcopy Create free account
hub / github.com/libgit2/pygit2 / __init__

Method __init__

pygit2/blob.py:20–43  ·  view source on GitHub ↗
(
        self,
        blob: Blob,
        as_path: Optional[str] = None,
        flags: BlobFilter = BlobFilter.CHECK_FOR_BINARY,
        commit_id: Optional[Oid] = None,
    )

Source from the content-addressed store, hash-verified

18 """
19
20 def __init__(
21 self,
22 blob: Blob,
23 as_path: Optional[str] = None,
24 flags: BlobFilter = BlobFilter.CHECK_FOR_BINARY,
25 commit_id: Optional[Oid] = None,
26 ):
27 super().__init__()
28 self._blob = blob
29 self._queue: Optional[Queue] = Queue(maxsize=1)
30 self._ready = threading.Event()
31 self._writer_closed = threading.Event()
32 self._chunk: Optional[bytes] = None
33 self._thread = threading.Thread(
34 target=self._blob._write_to_queue,
35 args=(self._queue, self._ready, self._writer_closed),
36 kwargs={
37 'as_path': as_path,
38 'flags': int(flags),
39 'commit_id': commit_id,
40 },
41 daemon=True,
42 )
43 self._thread.start()
44
45 def __exit__(self, exc_type, exc_value, traceback):
46 self.close()

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected