aboutsummaryrefslogtreecommitdiff
path: root/libxcb/xcb-proto/src/import.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-26 10:35:11 +0100
committermarha <marha@users.sourceforge.net>2012-01-26 10:35:11 +0100
commiteb4c088eb71f93b9639f4ff651523d794f1433f7 (patch)
tree5e95635c1768d7d8e640b298f6c6fbe38cd3c395 /libxcb/xcb-proto/src/import.py
parente6432710d8a586386b3c7025e845cf4f80830da3 (diff)
downloadvcxsrv-eb4c088eb71f93b9639f4ff651523d794f1433f7.tar.gz
vcxsrv-eb4c088eb71f93b9639f4ff651523d794f1433f7.tar.bz2
vcxsrv-eb4c088eb71f93b9639f4ff651523d794f1433f7.zip
xwininfo xcb-proto mesa xserver git update 26 12 2012
Diffstat (limited to 'libxcb/xcb-proto/src/import.py')
-rw-r--r--libxcb/xcb-proto/src/import.py66
1 files changed, 0 insertions, 66 deletions
diff --git a/libxcb/xcb-proto/src/import.py b/libxcb/xcb-proto/src/import.py
deleted file mode 100644
index eb58f5561..000000000
--- a/libxcb/xcb-proto/src/import.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/python
-
-from xml.sax.saxutils import XMLFilterBase, XMLGenerator
-from xml.sax import make_parser
-import sys, os
-
-path = [os.path.curdir, 'extensions']
-def find_file_on_path(name):
- for d in path:
- test = os.path.join(d, name)
- if os.path.isfile(test):
- return test
- raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), name)
-
-seen = {}
-
-class ProcessImports(XMLFilterBase):
- def setContentHandler(self, handler):
- self.handler = handler
- XMLFilterBase.setContentHandler(self, handler)
-
- def ensure(self, name):
- if not seen.has_key(name):
- child = ProcessImports(make_parser())
- child.setContentHandler(self.handler)
- child.parse(find_file_on_path(name + '.xml'))
-
- def startDocument(self):
- pass
- def endDocument(self):
- pass
-
- inimport = None
-
- def startElement(self, name, attrs):
- assert self.inimport is None
- if name == 'import':
- self.inimport = ""
- return
- XMLFilterBase.startElement(self, name, attrs)
- if name == 'xcb':
- seen[attrs['header']] = True
- self.ensure('xproto')
-
- def characters(self, content):
- if self.inimport is not None:
- self.inimport += content
- else:
- XMLFilterBase.characters(self, content)
-
- def endElement(self, name):
- if name == 'import':
- self.ensure(self.inimport)
- self.inimport = None
- return
- XMLFilterBase.endElement(self, name)
-
-out = XMLGenerator()
-importer = ProcessImports(make_parser())
-importer.setContentHandler(out)
-out.startDocument()
-if len(sys.argv) > 1:
- importer.parse(sys.argv[1])
-else:
- importer.parse(sys.stdin)
-out.endDocument()