Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 19882)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 19883)
@@ -174,4 +174,7 @@
 # so for users it look 'just being here' 
 VBox-python-glue_SOURCES = glue/vboxapi.py=>glue/python/vboxapi.py
+
+VBOX_PYTHON_CONSTANTS = $(VBOX_PATH_SDK)/bindings/glue/python/VirtualBox_constants.py
+OTHERS += $(VBOX_PYTHON_CONSTANTS)
 
 ifndef VBOX_ONLY_SDK # Note this goes on for *very* long
@@ -721,4 +724,7 @@
 	$(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
 
+$(VBOX_PYTHON_CONSTANTS):  $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
+	$(call MSG_TOOL,xsltproc,Python constants,$<,$@)
+	$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
 
 # Aliases for testing purposes.
Index: /trunk/src/VBox/Main/glue/vboxapi.py
===================================================================
--- /trunk/src/VBox/Main/glue/vboxapi.py	(revision 19882)
+++ /trunk/src/VBox/Main/glue/vboxapi.py	(revision 19883)
@@ -45,19 +45,35 @@
                     raise AttributeError
 
-            def __getattr__(self, attr):
-                if attr.startswith("__"):
-                    raise AttributeError
-
-                consts = self.__dict__['_consts']
-                fake = consts.get(attr, None)
-                if fake != None:
-                    return fake  
-                try:
-                    name = makeFullName(self, attr)
-                    return win32com.client.constants.__getattr__(name)
-                except AttributeError,e:
-                    fake = ConstantFake(self, attr)
-                    consts[attr] = fake
-                    return fake     
+        def __getattr__(self, attr):
+            import win32com
+            from win32com.client import constants
+                
+            if attr.startswith("__"):
+                raise AttributeError
+
+            consts = self.__dict__['_consts']
+            
+            fake = consts.get(attr, None)
+            if fake != None:
+               return fake  
+            try:
+               name = self.__dict__['_name']
+               parent = self.__dict__['_parent']
+               while parent != None:                  
+                  if parent._name is not None:
+                    name = parent._name+'_'+name
+                  parent = parent._parent
+                
+               if name is not None:
+                  name += "_" + attr
+               else:
+                  name = attr
+               print "ask",name
+               return win32com.client.constants.__getattr__(name)
+            except AttributeError,e:
+               fake = PlatformMSCOM.ConstantFake(self, attr)
+               consts[attr] = fake
+               return fake 
+
 
     class InterfacesWrapper:
@@ -66,4 +82,6 @@
 
             def __getattr__(self, a):
+                import win32com
+                from win32com.client import constants
                 if a.startswith("__"):
                     raise AttributeError
@@ -72,18 +90,4 @@
                 except AttributeError,e:
                     return self.__dict__['_rootFake'].__getattr__(a)
-
-    def makeFullName(fake, attr):
-            name = fake._name
-            parent = fake._parent
-            while parent != None:
-                if parent._name is not None:
-                    name = parent._name+'_'+name
-                parent = parent._parent
-                
-            if name is not None:
-                name += "_" + attr
-            else:
-                name = attr
-            return name
 
     def __init__(self, params):
