use p3k print

This commit is contained in:
j 2014-08-09 23:39:10 +02:00
parent 59e9966430
commit c236bef25a
1 changed files with 3 additions and 4 deletions

View File

@ -1,9 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import division
from __future__ import division, print_function
import os
import sys
import api
@ -18,12 +17,12 @@ else:
if command and command in names:
getattr(commands, "command_%s"%command)(sys.argv[1:])
else:
print 'usage: %s [action]' % 'ctl'
print("usage: ctl [action]")
indent = max([len(command) for command in names]) + 4
for command in sorted(names):
space = ' ' * (indent - len(command))
info = getattr(commands, "command_%s"%command).__doc__.split('\n')
info = [' %s%s' % (' ' * indent, i.strip()) for i in info]
info = '\n'.join(info).strip()
print " %s%s%s"%(command, space, info)
print(" %s%s%s" % (command, space, info))
sys.exit(1)