Introduce tostring function
This commit is contained in:
parent
82afb34f7a
commit
0f53a02947
2 changed files with 7 additions and 2 deletions
|
|
@ -295,11 +295,11 @@ class Videoob(ReplApplication):
|
|||
self.working_path.restore()
|
||||
return 1
|
||||
except CollectionNotFound:
|
||||
print >>sys.stderr, "Path: %s not found" % ('/'+'/'.join(req_path))
|
||||
print >>sys.stderr, "Path: %s not found" % self.working_path.tostring()
|
||||
self.working_path.restore()
|
||||
return 1
|
||||
|
||||
self.prompt = '%s:%s> ' % (self.APPNAME, '/' + '/'.join(req_path))
|
||||
self.prompt = '%s:%s> ' % (self.APPNAME, self.working_path.tostring() )
|
||||
|
||||
def complete_cd(self, text, line, begidx, endidx):
|
||||
mline = line.partition(' ')[2]
|
||||
|
|
|
|||
|
|
@ -54,3 +54,8 @@ class Path(object):
|
|||
|
||||
def get(self):
|
||||
return copy.copy(self._working_path)
|
||||
|
||||
def tostring(self):
|
||||
escape = lambda s: s.replace('/', '\/')
|
||||
path = map(escape, self._working_path)
|
||||
return '/' + '/'.join(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue