diff --git a/method.py b/method.py index 83b8797..4033883 100644 --- a/method.py +++ b/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: ",