X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xcbgen%2Fmatcher.py;h=bfa315eb5fd88c16d0782d27f1d645da72846738;hb=a66356e0d97e18f567a1fcc14e037fa190916463;hp=e7958fa44b18512dcb500eaf7e713ff2cbe61718;hpb=bf652a63fe0de259857ed174d7e921d645184634;p=free-sw%2Fxcb%2Fproto diff --git a/xcbgen/matcher.py b/xcbgen/matcher.py index e7958fa..bfa315e 100644 --- a/xcbgen/matcher.py +++ b/xcbgen/matcher.py @@ -9,18 +9,21 @@ we do not create a new type object, we just record the existing one under a new from os.path import join from xml.etree.cElementTree import parse -import state -from xtypes import * +from xcbgen.xtypes import * def import_(node, module, namespace): ''' For imports, we load the file, create a new namespace object, execute recursively, then record the import (for header files, etc.) ''' + # To avoid circular import error + from xcbgen import state + module.import_level = module.import_level + 1 new_file = join(namespace.dir, '%s.xml' % node.text) new_root = parse(new_file).getroot() new_namespace = state.Namespace(new_file) execute(module, new_namespace) + module.import_level = module.import_level - 1 if not module.has_import(node.text): module.add_import(node.text, new_namespace)