meta['stats'][m.group(1)]={'name': m.group(1), 'used': name}
    if not(l.find('INPUTSCHEME')==-1):
      m = re.search(r'INPUTSCHEME\((.*?)\)',l)
      if m:
        meta['inputscheme']=m.group(1)
    if not(l.find('OUTPUTSCHEME')==-1):
      m = re.search(r'OUTPUTSCHEME\((.*?)\)',l)
      if m:
        meta['outputscheme']=m.group(1)

  for k in ['options','stats','monitors']:
    if len(meta[k])==0:
      del meta[k]
  f.close()

addExtra(metadata)

def newline2br(a):
  return a.replace("\n","<br />")
  
def optionsashtml(option):
  return "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>" %(option['name'],option['type'],option['default'],newline2br(option['description']),newline2br(option['used']))

def statsashtml(stat):
  return "<tr><td>%s</td><td>%s</td></tr>" %(stat['name'],stat['used'])

def monitorsashtml(monitor):
  return "<tr><td>%s</td><td>%s</td></tr>" %(monitor['name'],monitor['used'])


Example #2
0
                meta['stats'][m.group(1)] = {'name': m.group(1), 'used': name}
        if not (l.find('INPUTSCHEME') == -1):
            m = re.search(r'INPUTSCHEME\((.*?)\)', l)
            if m:
                meta['inputscheme'] = m.group(1)
        if not (l.find('OUTPUTSCHEME') == -1):
            m = re.search(r'OUTPUTSCHEME\((.*?)\)', l)
            if m:
                meta['outputscheme'] = m.group(1)

    for k in ['options', 'stats', 'monitors']:
        if len(meta[k]) == 0:
            del meta[k]
    f.close()

addExtra(metadata)


def htmlescape(h):
    return h.replace(">", "&gt;").replace("<", "&lt;")


def newline2br(a):
    return a.replace("\n", "<br />")


def optionsashtml(option, used=True):
    if used:
        return "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>" % (
            option['name'], option['type'],
            newline2br(htmlescape(