Revision 033b7b64 tools/cfgshell
b/tools/cfgshell | ||
---|---|---|
186 | 186 |
def do_cd(self, line): |
187 | 187 |
"""Changes the current path. |
188 | 188 |
|
189 |
Valid arguments: either .. or a child of the current object. |
|
189 |
Valid arguments: either .., /, "" (no argument) or a child of the current |
|
190 |
object. |
|
190 | 191 |
|
191 | 192 |
""" |
192 | 193 |
if line == "..": |
... | ... | |
197 | 198 |
else: |
198 | 199 |
print "Already at top level" |
199 | 200 |
return False |
201 |
elif len(line) == 0 or line == "/": |
|
202 |
self.parents = self.parents[0:1] |
|
203 |
self.path = [] |
|
204 |
return False |
|
200 | 205 |
|
201 | 206 |
pointer = self.parents[-1] |
202 | 207 |
dirs, entries = self._get_entries(pointer) |
... | ... | |
317 | 322 |
|
318 | 323 |
return True |
319 | 324 |
|
325 |
|
|
320 | 326 |
class Error(Exception): |
321 | 327 |
"""Generic exception""" |
322 | 328 |
pass |
Also available in: Unified diff