2 from os
.path
import dirname
5 from MaKaC
.webinterface
import wcomponents
6 import MaKaC
.common
.Configuration
as Configuration
8 class WComponent(wcomponents
.WTemplated
):
9 def __init__(self
, conf
):
13 def _setTPLFile(self
):
14 """Sets the TPL (template) file for the object. It will try to get
15 from the configuration if there's a special TPL file for it and
16 if not it will look for a file called as the class name+".tpl"
17 in the configured TPL directory.
19 cfg
= Configuration
.Config
.getInstance()
20 dir = dirname(sys
.modules
[__name__
].__file
__)
21 file = cfg
.getTPLFile(self
.tplId
)
23 file = "%s.tpl" % self
.tplId
24 self
.tplFile
= os
.path
.join(dir, file)
26 class WCreate(WComponent
):
29 class WShow(WComponent
):
30 def __init__(self
, conf
, booking
):
31 WComponent
.__init
__(self
, conf
)
32 self
.booking
= booking