#!/usr/pkg/bin/python from string import * from os import listdir db = open("oids.db","r") oids = [] urls = {} descriptions = {} shortnames = {} shortnames["1"] = "iso" shortnames["1.2"] = "member-body" shortnames["1.2.826"] = "gb" shortnames["1.2.826.0"] = "national" shortnames["1.2.826.0.1"] = "eng-ltd" while 1: line = db.readline() if not line: break (oid,shortname,url,description) = split(line,None,3) shortnames[oid] = shortname descriptions[oid] = strip(description) urls[oid] = url oids.append(oid) oids.sort() db.close() def oid_asn1_format(oid): parts = split(oid,".") curoid = "" string = "{" while len(parts) > 0: item = parts.pop(0) if curoid != "": curoid = curoid + "." curoid = curoid + item if shortnames.has_key(curoid): string = string + " %s(%s)" % (shortnames[curoid],item) else: string = string + " %s" % item return string + " }" # Generate index.html html = open("index.html","w") html.write("