(self)
| 83 | return bn |
| 84 | |
| 85 | def walk(self): |
| 86 | # os.listdir will return unicode list if the argument is unicode. |
| 87 | # TODO: take care of the unicode names |
| 88 | for ent in os.listdir(u'.'): |
| 89 | if os.path.isdir(ent): |
| 90 | cwd = os.getcwd() |
| 91 | d = Folder(ent) |
| 92 | # depth-first |
| 93 | os.chdir(os.path.join(cwd, ent)) |
| 94 | d.walk() |
| 95 | # restore the cwd |
| 96 | os.chdir(cwd) |
| 97 | self._children.append(d) |
| 98 | else: |
| 99 | self._children.append(File(ent)) |
| 100 | |
| 101 | def sort(self): |
| 102 | def _sort(x, y): |
no test coverage detected