From c2b6775ed0be0c4ae8e0204923f6a32ab73a2c2e Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 19 Jul 2007 18:52:22 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- method.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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: ",