From e2cb9208d119f479f3ee87d059b7b9a8fe953471 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 11 Mar 2010 11:13:37 +0100 Subject: [PATCH] Return test string in test() function instead of printing it. --- patoolib/baker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patoolib/baker.py b/patoolib/baker.py index cfdc2ad..39823d8 100644 --- a/patoolib/baker.py +++ b/patoolib/baker.py @@ -550,7 +550,7 @@ class Baker(object): def test(self, argv=None): """Takes a list of command line arguments, parses it into a command - name and options, and prints what the resulting function call would + name and options, and returns what the resulting function call would look like. This may be useful for testing how command line arguments would be passed to your functions. @@ -560,10 +560,10 @@ class Baker(object): cmd, args, kwargs = self.parse(argv) result = "%s(%s" % (cmd.name, ",".join(repr(a) for a in args)) if kwargs: - kws = ", ".join("%s=%r" % (k, v) for k, v in kwargs.iteritems()) - result += ", " + kws + kws = ",".join("%s=%r" % (k, v) for k, v in kwargs.iteritems()) + result += "," + kws result += ")" - print result + return result _baker = Baker()