1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

samba-tool: max() with key option is available in python >= 2.6

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Amitay Isaacs 2011-09-09 13:24:10 +10:00 committed by Andrew Bartlett
parent b2a7fe166c
commit e9f155f52d

View File

@ -162,7 +162,7 @@ class SuperCommand(Command):
print "Available subcommands:"
subcmds = self.subcommands.keys()
subcmds.sort()
max_length = len(max(subcmds, key=len))
max_length = max(map(lambda c: len(c), subcmds))
for cmd in subcmds:
print " %*s - %s" % (-max_length, cmd, self.subcommands[cmd].description)
print " * server connection needed"