Mercurial > hgrepos > Python > apps > py-cutils
comparison cutils/util/walk.py @ 192:188de62caac6
Comment WalkDirEntry properties somewhat
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 16 Jan 2025 12:19:02 +0100 |
| parents | dac26a2d9de5 |
| children | e5f6f4db9157 |
comparison
equal
deleted
inserted
replaced
| 191:1b8bc876146a | 192:188de62caac6 |
|---|---|
| 43 self._fspath = None | 43 self._fspath = None |
| 44 self._is_symlink = self._is_dir = self._stat_result = None | 44 self._is_symlink = self._is_dir = self._stat_result = None |
| 45 | 45 |
| 46 @property | 46 @property |
| 47 def name(self): | 47 def name(self): |
| 48 """The native name""" | |
| 48 return self._name | 49 return self._name |
| 49 | 50 |
| 50 @property | 51 @property |
| 51 def fsname(self): | 52 def fsname(self): |
| 53 """The name as bytes""" | |
| 52 return self._fsname | 54 return self._fsname |
| 53 | 55 |
| 54 @property | 56 @property |
| 55 def path(self): | 57 def path(self): |
| 58 """Always native""" | |
| 56 return self._path | 59 return self._path |
| 57 | 60 |
| 58 @property | 61 @property |
| 59 def fspath(self): | 62 def fspath(self): |
| 63 """Always bytes""" | |
| 60 if self._path is not None: | 64 if self._path is not None: |
| 61 if self._fspath is None: | 65 if self._fspath is None: |
| 62 if PY2: | 66 if PY2: |
| 63 assert isinstance(self._path, bytes) | 67 assert isinstance(self._path, bytes) |
| 64 self._fspath = self._path | 68 self._fspath = self._path |
