1 # -*- coding: utf-8 -*-
4 ## This file is part of Indico.
5 ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
7 ## Indico is free software; you can redistribute it and/or
8 ## modify it under the terms of the GNU General Public License as
9 ## published by the Free Software Foundation; either version 3 of the
10 ## License, or (at your option) any later version.
12 ## Indico is distributed in the hope that it will be useful, but
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ## General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with Indico;if not, see <http://www.gnu.org/licenses/>.
20 from MaKaC.webinterface import wcomponents
23 import MaKaC.common.Configuration as Configuration
25 from MaKaC.plugins.EPayment import payPal
27 class WTemplated(wcomponents.WTemplated):
29 def _setTPLFile(self):
30 """Sets the TPL (template) file for the object. It will try to get
31 from the configuration if there's a special TPL file for it and
32 if not it will look for a file called as the class name+".tpl"
33 in the configured TPL directory.
35 cfg = Configuration.Config.getInstance()
36 dir = pkg_resources.resource_filename(payPal.__name__, "tpls")
37 file = cfg.getTPLFile( self.tplId )
39 file = "%s.tpl"%self.tplId
40 self.tplFile = os.path.join(dir, file)
42 hfile = self._getSpecificTPL(os.path.join(dir,'chelp'),
46 self.helpFile = os.path.join(dir,'chelp',hfile)