MCPcopy
hub / github.com/cool-RR/PySnooper / absolute

Method absolute

tests/mini_toolbox/pathlib.py:1316–1332  ·  view source on GitHub ↗

Return an absolute version of this path. This function works even if the path doesn't point to anything. No normalization is done, i.e. all '.' and '..' will be kept along. Use resolve() to get the canonical path to a file.

(self)

Source from the content-addressed store, hash-verified

1314 yield p
1315
1316 def absolute(self):
1317 """Return an absolute version of this path. This function works
1318 even if the path doesn't point to anything.
1319
1320 No normalization is done, i.e. all '.' and '..' will be kept along.
1321 Use resolve() to get the canonical path to a file.
1322 """
1323 # XXX untested yet!
1324 if self._closed:
1325 self._raise_closed()
1326 if self.is_absolute():
1327 return self
1328 # FIXME this must defer to the specific flavour (and, under Windows,
1329 # use nt._getfullpathname())
1330 obj = self._from_parts([os.getcwd()] + self._parts, init=False)
1331 obj._init(template=self)
1332 return obj
1333
1334 def resolve(self, strict=False):
1335 """

Callers 1

resolveMethod · 0.95

Calls 4

_raise_closedMethod · 0.95
is_absoluteMethod · 0.80
_from_partsMethod · 0.80
_initMethod · 0.45

Tested by

no test coverage detected