MCPcopy
hub / github.com/celery/celery / __init__

Method __init__

celery/backends/filesystem.py:36–54  ·  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

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