<s> from __future__ import print_function , unicode_literals <EOL> from collections import namedtuple <EOL> NO_DEFAULT = object ( ) <EOL> ANY_TYPE = object ( ) <EOL> _Argument = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> _sorted_variables = [ ] <EOL> DESCRIPTIONS = { } <EOL> COMMON = '<STR_LIT>' <EOL> DESCRIPTIONS [ COMMON ] = """<STR_LIT>""" <EOL> GENERAL = ( COMMON , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ GENERAL ] = """<STR_LIT>""" <EOL> DEBUG_MODE = '<STR_LIT>' <EOL> SERVER_ADMIN = '<STR_LIT>' <EOL> PROPAGATE_STACK_TRACES_TO_CLIENT = '<STR_LIT>' <EOL> FACADE_TIMEOUT = '<STR_LIT>' <EOL> SERVER_HOSTADDRESS = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( DEBUG_MODE , _Argument ( GENERAL , bool , False , "<STR_LIT>" ) ) , <EOL> ( SERVER_ADMIN , _Argument ( GENERAL , basestring , None , "<STR_LIT>" ) ) , <EOL> ( SERVER_HOSTADDRESS , _Argument ( GENERAL , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( PROPAGATE_STACK_TRACES_TO_CLIENT , _Argument ( GENERAL , bool , False , "<STR_LIT>" ) ) , <EOL> ( FACADE_TIMEOUT , _Argument ( GENERAL , float , <NUM_LIT:0.5> , "<STR_LIT>" ) ) , <EOL> ] ) <EOL> ADMIN_NOTIFIER = ( COMMON , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ ADMIN_NOTIFIER ] = """<STR_LIT>""" <EOL> MAIL_NOTIFICATION_ENABLED = '<STR_LIT>' <EOL> MAIL_SERVER_HOST = '<STR_LIT>' <EOL> MAIL_SERVER_HELO = '<STR_LIT>' <EOL> MAIL_SERVER_USE_TLS = '<STR_LIT>' <EOL> MAIL_NOTIFICATION_SENDER = '<STR_LIT>' <EOL> MAIL_NOTIFICATION_SUBJECT = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( MAIL_NOTIFICATION_ENABLED , _Argument ( ADMIN_NOTIFIER , bool , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( MAIL_SERVER_HOST , _Argument ( ADMIN_NOTIFIER , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( MAIL_SERVER_HELO , _Argument ( ADMIN_NOTIFIER , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( MAIL_SERVER_USE_TLS , _Argument ( ADMIN_NOTIFIER , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( MAIL_NOTIFICATION_SENDER , _Argument ( ADMIN_NOTIFIER , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( MAIL_NOTIFICATION_SUBJECT , _Argument ( ADMIN_NOTIFIER , basestring , "<STR_LIT>" , "<STR_LIT>" ) ) , <EOL> ] ) <EOL> DATABASE = ( COMMON , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ DATABASE ] = """<STR_LIT>""" <EOL> DB_HOST = '<STR_LIT>' <EOL> DB_PORT = '<STR_LIT>' <EOL> DB_DATABASE = '<STR_LIT>' <EOL> DB_ENGINE = '<STR_LIT>' <EOL> DB_ECHO = '<STR_LIT>' <EOL> DB_POOL_SIZE = '<STR_LIT>' <EOL> DB_MAX_OVERFLOW = '<STR_LIT>' <EOL> DB_USERNAME = '<STR_LIT>' <EOL> DB_PASSWORD = '<STR_LIT>' <EOL> DB_FORCE_ENGINE_CREATION = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( DB_HOST , _Argument ( DATABASE , basestring , '<STR_LIT:localhost>' , "<STR_LIT>" ) ) , <EOL> ( DB_PORT , _Argument ( DATABASE , int , None , "<STR_LIT>" ) ) , <EOL> ( DB_DATABASE , _Argument ( DATABASE , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( DB_ENGINE , _Argument ( DATABASE , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( DB_ECHO , _Argument ( DATABASE , bool , False , "<STR_LIT>" ) ) , <EOL> ( DB_POOL_SIZE , _Argument ( DATABASE , int , <NUM_LIT:5> , "<STR_LIT>" ) ) , <EOL> ( DB_MAX_OVERFLOW , _Argument ( DATABASE , int , <NUM_LIT> , "<STR_LIT>" ) ) , <EOL> ( DB_USERNAME , _Argument ( DATABASE , basestring , "<STR_LIT>" , "<STR_LIT>" ) ) , <EOL> ( DB_PASSWORD , _Argument ( DATABASE , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( DB_FORCE_ENGINE_CREATION , _Argument ( DATABASE , bool , False , "<STR_LIT>" ) ) , <EOL> ] ) <EOL> SESSIONS = ( COMMON , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ SESSIONS ] = """<STR_LIT>""" <EOL> SESSION_MANAGER_DEFAULT_TIMEOUT = '<STR_LIT>' <EOL> SESSION_MEMORY_GATEWAY_SERIALIZE = '<STR_LIT>' <EOL> SESSION_SQLALCHEMY_ENGINE = '<STR_LIT>' <EOL> SESSION_SQLALCHEMY_HOST = '<STR_LIT>' <EOL> SESSION_SQLALCHEMY_PORT = '<STR_LIT>' <EOL> SESSION_SQLALCHEMY_DB_NAME = '<STR_LIT>' <EOL> SESSION_SQLALCHEMY_USERNAME = '<STR_LIT>' <EOL> SESSION_SQLALCHEMY_PASSWORD = '<STR_LIT>' <EOL> SESSION_LOCK_SQLALCHEMY_ENGINE = '<STR_LIT>' <EOL> SESSION_LOCK_SQLALCHEMY_HOST = '<STR_LIT>' <EOL> SESSION_LOCK_SQLALCHEMY_PORT = '<STR_LIT>' <EOL> SESSION_LOCK_SQLALCHEMY_DB_NAME = '<STR_LIT>' <EOL> SESSION_LOCK_SQLALCHEMY_USERNAME = '<STR_LIT>' <EOL> SESSION_LOCK_SQLALCHEMY_PASSWORD = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( SESSION_SQLALCHEMY_ENGINE , _Argument ( SESSIONS , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( SESSION_SQLALCHEMY_HOST , _Argument ( SESSIONS , basestring , '<STR_LIT:localhost>' , "<STR_LIT>" ) ) , <EOL> ( SESSION_SQLALCHEMY_PORT , _Argument ( SESSIONS , int , None , "<STR_LIT>" ) ) , <EOL> ( SESSION_SQLALCHEMY_DB_NAME , _Argument ( SESSIONS , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( SESSION_SQLALCHEMY_USERNAME , _Argument ( SESSIONS , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( SESSION_SQLALCHEMY_PASSWORD , _Argument ( SESSIONS , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( SESSION_LOCK_SQLALCHEMY_ENGINE , _Argument ( SESSIONS , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( SESSION_LOCK_SQLALCHEMY_HOST , _Argument ( SESSIONS , basestring , '<STR_LIT:localhost>' , "<STR_LIT>" ) ) , <EOL> ( SESSION_LOCK_SQLALCHEMY_PORT , _Argument ( SESSIONS , int , None , "<STR_LIT>" ) ) , <EOL> ( SESSION_LOCK_SQLALCHEMY_DB_NAME , _Argument ( SESSIONS , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( SESSION_LOCK_SQLALCHEMY_USERNAME , _Argument ( SESSIONS , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( SESSION_LOCK_SQLALCHEMY_PASSWORD , _Argument ( SESSIONS , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( SESSION_MANAGER_DEFAULT_TIMEOUT , _Argument ( SESSIONS , int , <NUM_LIT> * <NUM_LIT:2> , "<STR_LIT>" ) ) , <EOL> ( SESSION_MEMORY_GATEWAY_SERIALIZE , _Argument ( SESSIONS , bool , False , "<STR_LIT>" ) ) , <EOL> ] ) <EOL> CORE_SERVER = '<STR_LIT>' <EOL> DESCRIPTIONS [ CORE_SERVER ] = """<STR_LIT>""" <EOL> CORE = ( CORE_SERVER , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ CORE ] = """<STR_LIT>""" <EOL> WEBLAB_CORE_SERVER_SESSION_TYPE = '<STR_LIT>' <EOL> WEBLAB_CORE_SERVER_SESSION_POOL_ID = '<STR_LIT>' <EOL> CORE_SERVER_URL = '<STR_LIT>' <EOL> CORE_STORE_STUDENTS_PROGRAMS = '<STR_LIT>' <EOL> CORE_STORE_STUDENTS_PROGRAMS_PATH = '<STR_LIT>' <EOL> CORE_UNIVERSAL_IDENTIFIER = '<STR_LIT>' <EOL> CORE_UNIVERSAL_IDENTIFIER_HUMAN = '<STR_LIT>' <EOL> CORE_GEOIP2_CITY_FILEPATH = '<STR_LIT>' <EOL> CORE_GEOIP2_COUNTRY_FILEPATH = '<STR_LIT>' <EOL> CORE_LOCAL_CITY = '<STR_LIT>' <EOL> CORE_LOCAL_COUNTRY = '<STR_LIT>' <EOL> CORE_IGNORE_LOCATIONS = '<STR_LIT>' <EOL> CORE_LOGO_PATH = '<STR_LIT>' <EOL> CORE_LOGO_SMALL_PATH = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( CORE_SERVER_URL , _Argument ( CORE , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( CORE_UNIVERSAL_IDENTIFIER , _Argument ( CORE , basestring , '<STR_LIT>' , """<STR_LIT>""" ) ) , <EOL> ( CORE_UNIVERSAL_IDENTIFIER_HUMAN , _Argument ( CORE , basestring , '<STR_LIT>' , """<STR_LIT>""" ) ) , <EOL> ( WEBLAB_CORE_SERVER_SESSION_TYPE , _Argument ( CORE , basestring , '<STR_LIT>' , """<STR_LIT>""" ) ) , <EOL> ( WEBLAB_CORE_SERVER_SESSION_POOL_ID , _Argument ( CORE , basestring , '<STR_LIT>' , """<STR_LIT>""" ) ) , <EOL> ( CORE_STORE_STUDENTS_PROGRAMS , _Argument ( CORE , bool , False , "<STR_LIT>" ) ) , <EOL> ( CORE_STORE_STUDENTS_PROGRAMS_PATH , _Argument ( CORE , basestring , None , "<STR_LIT>" ) ) , <EOL> ( CORE_GEOIP2_CITY_FILEPATH , _Argument ( CORE , basestring , "<STR_LIT>" , "<STR_LIT>" ) ) , <EOL> ( CORE_GEOIP2_COUNTRY_FILEPATH , _Argument ( CORE , basestring , "<STR_LIT>" , "<STR_LIT>" ) ) , <EOL> ( CORE_LOCAL_CITY , _Argument ( CORE , basestring , None , "<STR_LIT>" ) ) , <EOL> ( CORE_LOCAL_COUNTRY , _Argument ( CORE , basestring , None , "<STR_LIT>" ) ) , <EOL> ( CORE_IGNORE_LOCATIONS , _Argument ( CORE , bool , False , "<STR_LIT>" ) ) , <EOL> ( CORE_LOGO_PATH , _Argument ( CORE , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ( CORE_LOGO_SMALL_PATH , _Argument ( CORE , basestring , '<STR_LIT>' , "<STR_LIT>" ) ) , <EOL> ] ) <EOL> CORE_FACADE = ( CORE_SERVER , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ CORE_FACADE ] = """<STR_LIT>""" <EOL> CORE_FACADE_SERVER_ROUTE = '<STR_LIT>' <EOL> CORE_FACADE_BIND = '<STR_LIT>' <EOL> CORE_FACADE_PORT = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( CORE_FACADE_SERVER_ROUTE , _Argument ( CORE_FACADE , basestring , '<STR_LIT>' , """<STR_LIT>""" ) ) , <EOL> ( CORE_FACADE_BIND , _Argument ( CORE_FACADE , basestring , '<STR_LIT>' , """<STR_LIT>""" ) ) , <EOL> ( CORE_FACADE_PORT , _Argument ( CORE_FACADE , int , NO_DEFAULT , """<STR_LIT>""" ) ) , <EOL> ] ) <EOL> COORDINATOR = ( CORE_SERVER , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ COORDINATOR ] = """<STR_LIT>""" <EOL> COORDINATOR_IMPL = '<STR_LIT>' <EOL> COORDINATOR_DB_HOST = '<STR_LIT>' <EOL> COORDINATOR_DB_PORT = '<STR_LIT>' <EOL> COORDINATOR_DB_NAME = '<STR_LIT>' <EOL> COORDINATOR_DB_USERNAME = '<STR_LIT>' <EOL> COORDINATOR_DB_PASSWORD = '<STR_LIT>' <EOL> COORDINATOR_DB_ENGINE = '<STR_LIT>' <EOL> COORDINATOR_LABORATORY_SERVERS = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( COORDINATOR_IMPL , _Argument ( COORDINATOR , basestring , "<STR_LIT>" , "<STR_LIT>" ) ) , <EOL> ( COORDINATOR_DB_HOST , _Argument ( COORDINATOR , basestring , "<STR_LIT:localhost>" , """<STR_LIT>""" ) ) , <EOL> ( COORDINATOR_DB_PORT , _Argument ( COORDINATOR , int , None , """<STR_LIT>""" ) ) , <EOL> ( COORDINATOR_DB_NAME , _Argument ( COORDINATOR , basestring , "<STR_LIT>" , """<STR_LIT>""" ) ) , <EOL> ( COORDINATOR_DB_USERNAME , _Argument ( COORDINATOR , basestring , NO_DEFAULT , """<STR_LIT>""" ) ) , <EOL> ( COORDINATOR_DB_PASSWORD , _Argument ( COORDINATOR , basestring , NO_DEFAULT , """<STR_LIT>""" ) ) , <EOL> ( COORDINATOR_DB_ENGINE , _Argument ( COORDINATOR , basestring , "<STR_LIT>" , """<STR_LIT>""" ) ) , <EOL> ( COORDINATOR_LABORATORY_SERVERS , _Argument ( COORDINATOR , list , NO_DEFAULT , """<STR_LIT>""" ) ) , <EOL> ] ) <EOL> LOGIN_SERVER = '<STR_LIT>' <EOL> DESCRIPTIONS [ LOGIN_SERVER ] = """<STR_LIT>""" <EOL> LOGIN_FACADE = ( LOGIN_SERVER , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ LOGIN_FACADE ] = """<STR_LIT>""" <EOL> LOGIN_FACADE_TRUSTED_ADDRESSES = '<STR_LIT>' <EOL> LOGIN_FACADE_SERVER_ROUTE = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( LOGIN_FACADE_TRUSTED_ADDRESSES , _Argument ( LOGIN_FACADE , tuple , ( '<STR_LIT:127.0.0.1>' , ) , """<STR_LIT>""" ) ) , <EOL> ( LOGIN_FACADE_SERVER_ROUTE , _Argument ( LOGIN_FACADE , basestring , '<STR_LIT>' , """<STR_LIT>""" ) ) , <EOL> ] ) <EOL> LABORATORY_SERVER = '<STR_LIT>' <EOL> DESCRIPTIONS [ LABORATORY_SERVER ] = """<STR_LIT>""" <EOL> LABORATORY = ( LABORATORY_SERVER , '<STR_LIT>' ) <EOL> LABORATORY_SESSION_TYPE = '<STR_LIT>' <EOL> LABORATORY_SESSION_POOL_ID = '<STR_LIT>' <EOL> LABORATORY_ASSIGNED_EXPERIMENTS = '<STR_LIT>' <EOL> LABORATORY_EXCLUDE_CHECKING = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( LABORATORY_SESSION_TYPE , _Argument ( LABORATORY , basestring , "<STR_LIT>" , """<STR_LIT>""" ) ) , <EOL> ( LABORATORY_SESSION_POOL_ID , _Argument ( LABORATORY , basestring , "<STR_LIT>" , """<STR_LIT>""" ) ) , <EOL> ( LABORATORY_ASSIGNED_EXPERIMENTS , _Argument ( LABORATORY , list , NO_DEFAULT , """<STR_LIT>""" ) ) , <EOL> ( LABORATORY_EXCLUDE_CHECKING , _Argument ( LABORATORY , list , [ ] , """<STR_LIT>""" ) ) , <EOL> ] ) <EOL> PROXY_SERVER = '<STR_LIT>' <EOL> PROXY = ( PROXY_SERVER , '<STR_LIT>' ) <EOL> PROXY_EXPERIMENT_POLL_TIME = '<STR_LIT>' <EOL> PROXY_STORE_STUDENTS_PROGRAMS_PATH = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( PROXY_EXPERIMENT_POLL_TIME , _Argument ( PROXY , int , <NUM_LIT:30> , """<STR_LIT>""" ) ) , <EOL> ( PROXY_STORE_STUDENTS_PROGRAMS_PATH , _Argument ( PROXY , basestring , NO_DEFAULT , """<STR_LIT>""" ) ) , <EOL> ] ) <EOL> EXPERIMENTS = '<STR_LIT>' <EOL> DESCRIPTIONS [ EXPERIMENTS ] = "<STR_LIT>" <EOL> HTTP_EXPERIMENT = ( EXPERIMENTS , '<STR_LIT>' ) <EOL> DESCRIPTIONS [ HTTP_EXPERIMENT ] = "<STR_LIT>" <EOL> HTTP_EXPERIMENT_URL = '<STR_LIT>' <EOL> HTTP_EXPERIMENT_USERNAME = '<STR_LIT>' <EOL> HTTP_EXPERIMENT_PASSWORD = '<STR_LIT>' <EOL> HTTP_EXPERIMENT_BATCH = '<STR_LIT>' <EOL> _sorted_variables . extend ( [ <EOL> ( HTTP_EXPERIMENT_URL , _Argument ( HTTP_EXPERIMENT , basestring , NO_DEFAULT , "<STR_LIT>" ) ) , <EOL> ( HTTP_EXPERIMENT_USERNAME , _Argument ( HTTP_EXPERIMENT , basestring , None , "<STR_LIT>" ) ) , <EOL> ( HTTP_EXPERIMENT_PASSWORD , _Argument ( HTTP_EXPERIMENT , basestring , None , "<STR_LIT>" ) ) , <EOL> ( HTTP_EXPERIMENT_BATCH , _Argument ( HTTP_EXPERIMENT , bool , False , "<STR_LIT>" ) ) , <EOL> ] ) <EOL> variables = dict ( _sorted_variables ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from optparse import OptionParser <EOL> parser = OptionParser ( ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , default = '<STR_LIT>' , choices = ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> help = "<STR_LIT>" , metavar = "<STR_LIT>" ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> categories = set ( [ variable . category for variable in variables . values ( ) ] ) <EOL> categories . remove ( PROXY ) <EOL> variables_by_category = { } <EOL> sections = { } <EOL> for category in categories : <EOL> section , subsection = category <EOL> subsections = sections . get ( section , [ ] ) <EOL> if subsection == '<STR_LIT>' : <EOL> subsections . insert ( <NUM_LIT:0> , subsection ) <EOL> else : <EOL> subsections . append ( subsection ) <EOL> sections [ section ] = subsections <EOL> variables_by_category [ category ] = [ variable for variable in variables if variables [ variable ] . category == category ] <EOL> if options . format == '<STR_LIT>' : <EOL> for section in sections : <EOL> print ( '<STR_LIT:U+0020>' . join ( ( '<STR_LIT:=>' * <NUM_LIT:3> , section , '<STR_LIT:=>' * <NUM_LIT:3> ) ) ) <EOL> print ( ) <EOL> for subsection in sections [ section ] : <EOL> print ( '<STR_LIT:U+0020>' . join ( ( '<STR_LIT:=>' * <NUM_LIT:4> , subsection , '<STR_LIT:=>' * <NUM_LIT:4> ) ) ) <EOL> print ( ) <EOL> category = ( section , subsection ) <EOL> print ( "<STR_LIT>" ) <EOL> for variable , argument in _sorted_variables : <EOL> if variable in variables_by_category [ category ] : <EOL> print ( "<STR_LIT>" % { <EOL> '<STR_LIT>' : variable , <EOL> '<STR_LIT:type>' : variables [ variable ] . type . __name__ , <EOL> '<STR_LIT:default>' : variables [ variable ] . default if variables [ variable ] . default is not NO_DEFAULT else '<STR_LIT>' , <EOL> '<STR_LIT>' : variables [ variable ] . message <EOL> } ) <EOL> print ( ) <EOL> elif options . format == '<STR_LIT>' : <EOL> print ( "<STR_LIT>" ) <EOL> print ( ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( ) <EOL> for section in sections : <EOL> print ( section ) <EOL> print ( '<STR_LIT:->' * len ( section ) ) <EOL> print ( ) <EOL> if section in DESCRIPTIONS : <EOL> print ( DESCRIPTIONS [ section ] ) <EOL> print ( ) <EOL> for subsection in sections [ section ] : <EOL> print ( subsection ) <EOL> print ( '<STR_LIT>' * len ( subsection ) ) <EOL> print ( ) <EOL> category = ( section , subsection ) <EOL> if category in DESCRIPTIONS : <EOL> print ( DESCRIPTIONS [ category ] ) <EOL> print ( ) <EOL> header1 = '<STR_LIT>' <EOL> header2 = '<STR_LIT>' <EOL> header3 = '<STR_LIT>' <EOL> header4 = '<STR_LIT>' <EOL> max_c1 , max_c2 , max_c3 , max_c4 = len ( header1 ) , len ( header2 ) , len ( header3 ) , len ( header4 ) <EOL> for variable , argument in _sorted_variables : <EOL> if variable in variables_by_category [ category ] : <EOL> name = variable <EOL> type = variables [ variable ] . type . __name__ <EOL> default = unicode ( variables [ variable ] . default if variables [ variable ] . default is not NO_DEFAULT else '<STR_LIT>' ) <EOL> doc = variables [ variable ] . message <EOL> if len ( name ) > max_c1 : <EOL> max_c1 = len ( name ) <EOL> if len ( type ) > max_c2 : <EOL> max_c2 = len ( type ) <EOL> if len ( default ) > max_c3 : <EOL> max_c3 = len ( default ) <EOL> if len ( doc ) > max_c4 : <EOL> max_c4 = len ( doc ) <EOL> def sfill ( s , n ) : <EOL> return s + '<STR_LIT:U+0020>' * ( n - len ( s ) ) <EOL> def print_row ( s1 , s2 , s3 , s4 ) : <EOL> print ( sfill ( s1 , max_c1 ) , sfill ( s2 , max_c2 ) , sfill ( s3 , max_c3 ) , sfill ( s4 , max_c4 ) ) <EOL> print ( '<STR_LIT:=>' * max_c1 , '<STR_LIT:=>' * max_c2 , '<STR_LIT:=>' * max_c3 , '<STR_LIT:=>' * max_c4 ) <EOL> print_row ( header1 , header2 , header3 , header4 ) <EOL> print ( '<STR_LIT:=>' * max_c1 , '<STR_LIT:=>' * max_c2 , '<STR_LIT:=>' * max_c3 , '<STR_LIT:=>' * max_c4 ) <EOL> for variable , argument in _sorted_variables : <EOL> if variable in variables_by_category [ category ] : <EOL> name = variable <EOL> type = variables [ variable ] . type . __name__ <EOL> default = unicode ( variables [ variable ] . default if variables [ variable ] . default is not NO_DEFAULT else '<STR_LIT>' ) <EOL> doc = variables [ variable ] . message <EOL> print_row ( name , type , default , doc ) <EOL> print ( '<STR_LIT:=>' * max_c1 , '<STR_LIT:=>' * max_c2 , '<STR_LIT:=>' * max_c3 , '<STR_LIT:=>' * max_c4 ) <EOL> print ( ) <EOL> else : <EOL> print ( "<STR_LIT>" % options . format ) </s>
