From 9449dbfe1bb1800dfb15de025b87e1846e25e74a Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 9 Dec 2014 13:58:28 +0000 Subject: Tiny optimisation of app.runcmd code path --- morphlib/app.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'morphlib') diff --git a/morphlib/app.py b/morphlib/app.py index b5bcb601..6964be56 100644 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -358,16 +358,15 @@ class Morph(cliapp.Application): else: print_command = True - # convert the command line arguments into a string - commands = [argv] + list(args) - for command in commands: - if isinstance(command, list): - for i in xrange(0, len(command)): - command[i] = str(command[i]) - commands = [' '.join(command) for command in commands] - - # print the command line if print_command: + # Print the command line + commands = [argv] + list(args) + for command in commands: + if isinstance(command, list): + for i in xrange(0, len(command)): + command[i] = str(command[i]) + commands = [' '.join(command) for command in commands] + self.status(msg='# %(cmdline)s', cmdline=' | '.join(commands), chatty=True) -- cgit v1.2.1