2013-04-19 22:06:05 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
import sys
|
2013-04-21 22:17:47 +02:00
|
|
|
import lutinDebug as debug
|
2013-04-19 22:06:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class heritage:
|
|
|
|
def __init__(self, module):
|
|
|
|
## Remove all variable to prevent error of multiple definition
|
|
|
|
# all the parameter that the upper classe need when build
|
|
|
|
self.flags_ld=[]
|
|
|
|
self.flags_cc=[]
|
|
|
|
self.flags_xx=[]
|
|
|
|
self.flags_m=[]
|
|
|
|
self.flags_mm=[]
|
|
|
|
# sources list:
|
|
|
|
self.src=[]
|
|
|
|
self.path=[]
|
|
|
|
# update is set at true when data are newly created ==> force upper element to update
|
|
|
|
self.hasBeenUpdated=False
|
|
|
|
|
|
|
|
if type(module) != type(None):
|
|
|
|
# all the parameter that the upper classe need when build
|
|
|
|
self.flags_ld=module.export_flags_ld
|
|
|
|
self.flags_cc=module.export_flags_cc
|
|
|
|
self.flags_xx=module.export_flags_xx
|
|
|
|
self.flags_m=module.export_flags_m
|
|
|
|
self.flags_mm=module.export_flags_mm
|
|
|
|
self.path=module.export_path
|
|
|
|
|
2013-04-24 12:50:14 +02:00
|
|
|
def AppendAndCheck(self, listout, newElement):
|
|
|
|
for element in listout:
|
|
|
|
if element==newElement:
|
|
|
|
return
|
|
|
|
listout.append(newElement)
|
|
|
|
|
2013-04-19 22:06:05 +02:00
|
|
|
def AppendToInternalList(self, listout, list):
|
|
|
|
if type(list) == type(str()):
|
2013-04-24 12:50:14 +02:00
|
|
|
self.AppendAndCheck(listout, list)
|
2013-04-19 22:06:05 +02:00
|
|
|
else:
|
|
|
|
# mulyiple imput in the list ...
|
|
|
|
for elem in list:
|
2013-04-24 12:50:14 +02:00
|
|
|
self.AppendAndCheck(listout, elem)
|
2013-04-19 22:06:05 +02:00
|
|
|
|
|
|
|
def AddFlag_LD(self, list):
|
|
|
|
self.AppendToInternalList(self.flags_ld, list)
|
|
|
|
|
|
|
|
def AddFlag_CC(self, list):
|
|
|
|
self.AppendToInternalList(self.flags_cc, list)
|
|
|
|
|
|
|
|
def AddFlag_XX(self, list):
|
|
|
|
self.AppendToInternalList(self.flags_xx, list)
|
|
|
|
|
|
|
|
def AddFlag_M(self, list):
|
|
|
|
self.AppendToInternalList(self.flags_m, list)
|
|
|
|
|
|
|
|
def AddFlag_MM(self, list):
|
|
|
|
self.AppendToInternalList(self.flags_mm, list)
|
|
|
|
|
|
|
|
def AddImportPath(self, list):
|
|
|
|
self.AppendToInternalList(self.path, list)
|
|
|
|
|
|
|
|
def AddSources(self, list):
|
|
|
|
self.AppendToInternalList(self.src, list)
|
|
|
|
|
|
|
|
def NeedUpdate(self, list):
|
|
|
|
self.hasBeenUpdated=True
|
|
|
|
|
|
|
|
def AddSub(self, other):
|
|
|
|
if type(other) == type(None):
|
|
|
|
debug.verbose("input of the heriatege class is None !!!")
|
|
|
|
return
|
|
|
|
if other.hasBeenUpdated==True:
|
|
|
|
self.hasBeenUpdated = True
|
|
|
|
self.AddFlag_LD(other.flags_ld)
|
|
|
|
self.AddFlag_CC(other.flags_cc)
|
|
|
|
self.AddFlag_XX(other.flags_xx)
|
|
|
|
self.AddFlag_M(other.flags_m)
|
|
|
|
self.AddFlag_MM(other.flags_mm)
|
|
|
|
self.AddImportPath(other.path)
|
|
|
|
self.AddSources(other.src)
|