MCPcopy Create free account
hub / github.com/celery/celery / __init__

Method __init__

celery/backends/filesystem.py:39–57  ·  view source on GitHub ↗
(self, url=None, open=open, unlink=os.unlink, sep=os.sep,
                 encoding=default_encoding, *args, **kwargs)

Source from the content-addressed store, hash-verified

37 supports_result_compression = True
38
39 def __init__(self, url=None, open=open, unlink=os.unlink, sep=os.sep,
40 encoding=default_encoding, *args, **kwargs):
41 super().__init__(*args, **kwargs)
42 self.url = url
43 path = self._find_path(url)
44
45 # Remove forwarding "/" for Windows os
46 if os.name == "nt" and path.startswith("/"):
47 path = path[1:]
48
49 # We need the path and separator as bytes objects
50 self.path = path.encode(encoding)
51 self.sep = sep.encode(encoding)
52
53 self.open = open
54 self.unlink = unlink
55
56 # Let's verify that we've everything setup right
57 self._do_directory_test(b'.fs-backend-' + uuid().encode(encoding))
58
59 def __reduce__(self, args=(), kwargs=None):
60 kwargs = {} if not kwargs else kwargs

Callers

nothing calls this directly

Calls 3

_find_pathMethod · 0.95
_do_directory_testMethod · 0.95
encodeMethod · 0.45

Tested by

no test coverage detected