Kaydet (Commit) 7e0bc112 authored tarafından Jack Jansen's avatar Jack Jansen

Patch 702620 by Donovan Preston: Fix AE inheritance.

üst 82ad32ec
...@@ -503,10 +503,10 @@ class ComponentItem(SelectableItem): ...@@ -503,10 +503,10 @@ class ComponentItem(SelectableItem):
# Also, dictionaries _propdict and _elemdict must be set to map property # Also, dictionaries _propdict and _elemdict must be set to map property
# and element names to the correct classes # and element names to the correct classes
_propdict = {}
_elemdict = {}
def __init__(self, which, fr = None): def __init__(self, which, fr = None):
SelectableItem.__init__(self, self.want, which, fr) SelectableItem.__init__(self, self.want, which, fr)
self._propdict = {}
self._elemdict = {}
def __repr__(self): def __repr__(self):
if not self.fr: if not self.fr:
......
...@@ -321,14 +321,15 @@ def compileaete(aete, resinfo, fname): ...@@ -321,14 +321,15 @@ def compileaete(aete, resinfo, fname):
fp.write("from %s import *\n"%modname) fp.write("from %s import *\n"%modname)
# Generate property dicts and element dicts for all types declared in this module # Generate property dicts and element dicts for all types declared in this module
fp.write("def getbaseclasses(v):\n") fp.write("\ndef getbaseclasses(v):\n")
fp.write("\tif hasattr(v, '_superclassnames') and not hasattr(v, '_propdict'):\n") fp.write("\tif not v._propdict:\n")
fp.write("\t\tv._propdict = {}\n") fp.write("\t\tv._propdict = {}\n")
fp.write("\t\tv._elemdict = {}\n") fp.write("\t\tv._elemdict = {}\n")
fp.write("\t\tfor superclass in v._superclassnames:\n") fp.write("\t\tfor superclassname in getattr(v, '_superclassnames', []):\n")
## fp.write("\t\t\tgetbaseclasses(superclass)\n") fp.write("\t\t\tsuperclass = eval(superclassname)\n")
fp.write("\t\t\tv._propdict.update(getattr(eval(superclass), '_privpropdict', {}))\n") fp.write("\t\t\tgetbaseclasses(superclass)\n")
fp.write("\t\t\tv._elemdict.update(getattr(eval(superclass), '_privelemdict', {}))\n") fp.write("\t\t\tv._propdict.update(getattr(superclass, '_propdict', {}))\n")
fp.write("\t\t\tv._elemdict.update(getattr(superclass, '_elemdict', {}))\n")
fp.write("\t\tv._propdict.update(v._privpropdict)\n") fp.write("\t\tv._propdict.update(v._privpropdict)\n")
fp.write("\t\tv._elemdict.update(v._privelemdict)\n") fp.write("\t\tv._elemdict.update(v._privelemdict)\n")
fp.write("\n") fp.write("\n")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment