From 9969dadab93bf4220f9bdfcc0c91e9c82223e9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BF=D0=B8=D1=80=D0=B8=D0=B4=D0=BE=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=94=D0=B5=D0=BD=D0=B8=D1=81?= Date: Thu, 12 Jul 2012 16:46:57 +0400 Subject: [PATCH] fixed width help --- console/application/methods_func.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/console/application/methods_func.py b/console/application/methods_func.py index 4340f6b..cef0403 100644 --- a/console/application/methods_func.py +++ b/console/application/methods_func.py @@ -21,20 +21,12 @@ setLocalTranslate('calculate_console',sys.modules[__name__]) import urllib2 from calculate.core.server.methods_func import get_method_argparser, \ - collect_object + collect_object, RawAndDefaultsHelpFormatter -#class help_form (argparse.HelpFormatter): -# def __init__(self,prog, indent_increment=2, max_help_position=24, -# width=None): -# from fcntl import ioctl -# from array import array -# import termios -# h,w=array('h', ioctl(sys.stderr,termios.TIOCGWINSZ,'\0'*8))[:2] -# argparse.HelpFormatter.__init__(self, prog, indent_increment, -# max_help_position, w) def parse(): -# parser = argparse.ArgumentParser(add_help=False,formatter_class=help_form) - parser = argparse.ArgumentParser(add_help=False) + parser = argparse.ArgumentParser(add_help=False, + formatter_class=RawAndDefaultsHelpFormatter) +# parser = argparse.ArgumentParser(add_help=False) parser.add_argument( '-h', '--help', action='store_true', default=False, dest='help', help=_("show this help message and exit")) @@ -130,7 +122,6 @@ def call_method(client, args, wait_thread): raise Exception(1) param_object, steps = collect_object(client, param_object, view, args, wait_thread) - if steps.label and hasattr (param_object, 'CheckOnly'): param_object['CheckOnly'] = True # print param_object