parent
0b4cd8dc7b
commit
c2b6775ed0
12
method.py
12
method.py
|
@ -183,6 +183,18 @@ class OpenAesFile(Method):
|
|||
b = w.application.open_path(vargs['filename'], 'aes', vargs['password'])
|
||||
SwitchBuffer().execute(w, buffername=b.name())
|
||||
return
|
||||
|
||||
class ViewBufferParent(Method):
|
||||
def _execute(self, w, **vargs):
|
||||
b = w.buffer
|
||||
if not hasattr(b, 'path'):
|
||||
w.set_error('Buffer has not path')
|
||||
elif b.path == '/':
|
||||
w.set_error("Root directory has no parent")
|
||||
else:
|
||||
path = os.path.dirname(b.path)
|
||||
w.application.methods['open-file'].execute(w, filename=path)
|
||||
|
||||
class SwitchBuffer(Method):
|
||||
'''Switch to a different'''
|
||||
args = [Argument('buffername', datatype="buffer", prompt="Switch To Buffer: ",
|
||||
|
|
Loading…
Reference in New Issue