ajout d'erreurs personalisees et du module digicode
darcs-hash:20061009172906-f46e9-390eff7e704b7cad2f6a4f3ec8a426fbef179d0b.gz
This commit is contained in:
parent
8c44cac872
commit
bd9ead0d89
11 changed files with 158 additions and 23 deletions
|
@ -34,14 +34,14 @@ parser.add_option("-p", "--port",
|
|||
|
||||
# on suppose qu'en version de developpement, le script est lance depuis le shell
|
||||
if (options.dev):
|
||||
cherrypy.config.update(file=os.getcwd() + "/conf/dev.cfg")
|
||||
cherrypy.config.update(file=os.getcwd() + "/conf/intranet.cfg")
|
||||
cherrypy.config.update(file=os.getcwd() + "/conf/dev.cfg")
|
||||
settings={'global': { 'rootDir': os.getcwd() } }
|
||||
cherrypy.config.update(settings)
|
||||
|
||||
else:
|
||||
cherrypy.config.update(file="/usr/scripts/intranet/conf/prod.cfg")
|
||||
cherrypy.config.update(file="/usr/scripts/intranet/conf/intranet.cfg")
|
||||
cherrypy.config.update(file="/usr/scripts/intranet/conf/prod.cfg")
|
||||
|
||||
# changer le port ??
|
||||
if (options.port):
|
||||
|
@ -71,7 +71,7 @@ from plugins.verifdroitsfilter import VerifDroitsFilter
|
|||
class Intranet:
|
||||
__ldap = None
|
||||
def __init__(self):
|
||||
from pages import monCompte, impression, factures
|
||||
from pages import monCompte, impression, factures, digicode
|
||||
self.__ldap = cherrypy.config.configMap["global"]["crans_ldap"]
|
||||
|
||||
# liste des modules disponibles
|
||||
|
@ -80,7 +80,8 @@ class Intranet:
|
|||
self.impression = impression.root()
|
||||
|
||||
# liste des modules en developpement
|
||||
#if (cherrypy.config.configMap["global"]["server.environment"] == "development"):
|
||||
if (cherrypy.config.configMap["global"]["server.environment"] == "development"):
|
||||
self.digicode = digicode.root()
|
||||
|
||||
|
||||
|
||||
|
@ -100,14 +101,23 @@ class Intranet:
|
|||
}
|
||||
info.exposed = True
|
||||
|
||||
'''
|
||||
|
||||
def _cp_on_http_error(self, status, message):
|
||||
cherrypy.response.body = {
|
||||
'template':'error',
|
||||
'values':{'status':status, 'message':message },
|
||||
'standalone':False,
|
||||
}
|
||||
'''
|
||||
if status==403:
|
||||
cherrypy.response.body = {
|
||||
'template':'error403',
|
||||
'values':{'status':status, 'message':message },
|
||||
'standalone':False,
|
||||
}
|
||||
elif status==404:
|
||||
cherrypy.response.body = {
|
||||
'template':'error',
|
||||
'values':{'status':status, 'message':message },
|
||||
'standalone':False,
|
||||
}
|
||||
else:
|
||||
cherrypy._cputil._cp_on_http_error(status, message)
|
||||
|
||||
'''
|
||||
def nounous(self):
|
||||
return "coucou"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue