6.21.1. Help Dictionary

Start python section to interscript/getframes.py[2 /3 ] Next Prev First Last
    10: #line 20 "interscript_options.ipk"
    11: #option help dictionary
    12: shortoptdict = { 'v':'verbose (trace everything)' }
    13: 
    14: longoptdict = {
    15:   'weaver=': {
    16:     'html': 'flat html',
    17:     'latex': 'latex2e',
    18:     'llambda': 'lambda',
    19:     'text':'plain text',
    20:     'web':'html tree',
    21:     'lout':'lout'
    22:   },
    23:   'language=': 'two letter code for human language to weave (mandatory if weaver selected)',
    24:   'tangler-prefix=':'absolute native os prefix prepended to tangled code filenames',
    25:   'weaver-prefix=':'absolute native os prefix prepended to woven documentation filenames',
    26:   'tangler-directory=':'interscript filename prefix prepended to tangled code filenames',
    27:   'weaver-directory=':'interscript filename prefix prepended to woven documentation filenames',
    28:   'python=':'execute python script',
    29:   'update=':{
    30:     0:'Allow buffered file write (default)',
    31:     1:'Inhibit buffered file write'},
    32:   'download=':{
    33:     'never':'do not download from the Internet',
    34:     'always':'force download by ftp or http'},
    35:   'refresh_interval=':
    36:     'download when local file is older than this number of days (default 28)',
    37:   'tabwidth=':'column width for tab expansion (default 8)',
    38:   'passes=':'passs on each file (default 1)',
    39:   'logfile=':'<filename> for messages (append to old file)',
    40:   'new-logfile=':'<filename> for messages (cleared first)',
    41:   'nocache':'disable persistent cache usage',
    42:   'copyright': '(prints) Maxtal P/L Australia',
    43:   'licence': '(prints) Free for any use',
    44:   'author': '(prints) mailto:skaller@maxtal.com.au <John Skaller>',
    45:   'homepage': '(prints) http://www.triode.net.au/~skaller/interscript',
    46:   'executable': 'print python executable name',
    47:   'python-version': 'print python version string',
    48:   'title=':'set document title',
    49:   'encoding=':'encoding of file, defaults to utf8',
    50:   'test':'MUST BE FIRST: try to load interscript from current directory',
    51:   'html-eol=': {
    52:     'CRLF': 'Kludge Unix host (only) to end html lines (only) with CR/LF'
    53:   },
    54:   'trace=':{
    55:     'frames'  : 'creation and destruction of architectural frames',
    56:     'weavers' : 'creation and destruction of weavers',
    57:     'tanglers': 'creation and destruction of tanglers',
    58:     'sinks'   : 'creation and destructioin of sinks',
    59:     'sources' : 'opening and closing of sources',
    60:     'changes' : 'changed outputs',
    61:     'script'  : 'execution of client script',
    62:     'options' : 'dump options',
    63:     'input'   : 'list all input lines',
    64:     'cache'   : 'contents of persistent storage on loading and saving',
    65:     'deps'    : 'source file dependency and change tracking'
    66:   },
    67:   'help':'this help',
    68:   'usage':'this help' }
    69: 
    70: 
    71: def print_help():
    72:   print 'Usage: python iscr.py [options] <filename>'
    73:   print 'Short options:'
    74:   keys = shortoptdict.keys()
    75:   keys.sort()
    76:   for k in keys: print_help1(k)
    77:   print 'Long options:'
    78:   keys = longoptdict.keys()
    79:   keys.sort()
    80:   for k in keys: print_help1(k)
    81: 
    82: def print_help1(k):
    83:   if longoptdict.has_key(k):
    84:     usek = '--'+ k
    85:     values = longoptdict[k]
    86:   elif longoptdict.has_key(k+'='):
    87:     usek = '--'+ k + '='
    88:     values = longoptdict[k+'=']
    89:   elif shortoptdict.has_key(k):
    90:     usek = '-' + k
    91:     values = shortoptdict[k]
    92:   elif shortoptdict.has_key(k+'='):
    93:     usek = '-' + k + '='
    94:     values = shortoptdict[k+'=']
    95:   else:
    96:     usek = k
    97:     values = 'Unknown option'
    98: 
    99:   print '  '+usek,
   100:   if values is None:
   101:     print
   102:   elif type(values) is type({}):
   103:     print
   104:     for value in values.keys():
   105:       print '   '+str(value)+':',values[value]
   106:   else:
   107:     print values
   108: 
End python section to interscript/getframes.py[2]