head 1.2; access; symbols libdrm-1_0_4:1.2 trunk-20021125:1.1 mesa-4-1-branch:1.1.0.2; locks; strict; comment @# @; 1.2 date 2003.06.25.14.40.08; author jrfonseca; state Exp; branches; next 1.1; 1.1 date 2002.04.14.11.28.08; author jrfonseca; state Exp; branches; next ; desc @@ 1.2 log @Switch the source format to DocBook XML. @ text @#!/usr/bin/env python import sgmllib, sys class GlossaryParser(sgmllib.SGMLParser): def __init__ (self): sgmllib.SGMLParser.__init__ (self) self.is_acronym = 0 def unknown_starttag (self, tag, attrs): if tag == 'glossentry': self.id = '' self.acronym = '' for attr in attrs: if attr[0] == "id": self.id = attr[1] break if tag == 'acronym': self.is_acronym = 1 def unknown_endtag (self, tag): if tag == 'glossentry': id = self.id acronym = self.acronym.strip() if not acronym: return for blacklisted in ' \t&;': if blacklisted in acronym: return print "" + acronym + "'>" if tag == 'acronym': self.is_acronym = 0 def handle_data (self, data): if self.is_acronym: self.acronym = self.acronym + data def main(): fd = open(sys.argv[1]) p = GlossaryParser() p.feed(fd.read()) p.close() if __name__ == "__main__": main() @ 1.1 log @Updated the Makefile for uploading the FAQ in other formats to the DRI website. Created an automated system for creating glossary links easily, e.g., to have an embebed link to the glossary definition of DMA one just has to write &DMA; instead. Bootstraped a new section named "Implementation" which will receive some of the in-depth content of the "Architecture" section. Remove the empty file "techniques.sgml" as its potential content will be now on "implementation.sgml" instead. @ text @a1 3 import sgmllib import string import sys d3 1 d5 2 a6 1 class GlossaryParser (sgmllib.SGMLParser): d27 1 a27 1 acronym = string.strip(self.acronym) d45 2 a46 1 if __name__ == "__main__": d53 3 @