From 5c7eaa31514939d795ed6000bd3b768cc8f2451d Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Fri, 22 Apr 2011 22:06:14 +0200 Subject: [PATCH] Pastoob fixes Do not use print (as it add a newline), fix the wanted fields, use "get" instead of "show". --- weboob/applications/pastoob/pastoob.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/weboob/applications/pastoob/pastoob.py b/weboob/applications/pastoob/pastoob.py index 78d7f1a6..a29c29d0 100644 --- a/weboob/applications/pastoob/pastoob.py +++ b/weboob/applications/pastoob/pastoob.py @@ -38,22 +38,23 @@ class Pastoob(ReplApplication): self.load_config() return ReplApplication.main(self, argv) - def do_show(self, _id): + def do_get(self, _id): """ - show ID + get ID Get a paste contents. """ if not _id: - print >>sys.stderr, 'This command takes an argument: %s' % self.get_command_help('show', short=True) + print >>sys.stderr, 'This command takes an argument: %s' % self.get_command_help('get', short=True) return 1 try: - paste = self.get_object(_id, 'get_paste', ['title']) + paste = self.get_object(_id, 'get_paste', ['contents']) except PasteNotFound: print >>sys.stderr, 'Paste not found: %s' % _id return 2 if not paste: print >>sys.stderr, 'Unable to handle paste: %s' % _id return 3 - print paste.contents + output = sys.stdout + output.write(paste.contents)