以下の関数の頭の痛い問題を考えると、PrintingTemplate が継承している utils.PrintingTemplateBase オブジェクトで関数を呼び出すにはどうすればよいでしょうか?
また、PrintingTemplateBase を使用するにはそれ自体のインスタンスが必要であることにも言及します (最も近いのは PrintingTemplate です)。
class PrintingTemplate (utils.PrintingTemplateBase) :
# Class used to accumulate lines of data
#
class LineData :
# Class constructor, optionally passed an existing instance in which case
# data is copied.
#
def __init__ (self, data = None) :
self.number_of_panes = 0
self.material = ''
#--------------------------------------------------------------------------
#
# LineData subclass for data coming from CalcGlass
#
class LineDataGlass (LineData) :
def __init__ (self, calc_glass) :
self.number_of_panes = calc_glass.calc_component.calc_subitem.item.quantity
try : self.material = calc_glass.glass_unit.workshop_description
except : self.material = 'Undefined glass'
def __init__(self) :
utils.PrintingTemplateBase.__init__ (self)
self.constants = None