[intranet] suppression des trailing whitespaces qui gênent la lecture
darcs-hash:20090128153306-bd074-4a8923921ada6494c88bee3a177042f771249f1b.gz
This commit is contained in:
parent
636e75038f
commit
0abe5fb17f
3 changed files with 83 additions and 84 deletions
|
@ -1,28 +1,28 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
# #############################################################
|
||||
# ..
|
||||
# .... ............ ........
|
||||
# . ....... . .... ..
|
||||
# . ... .. .. .. .. ..... . ..
|
||||
# .. .. ....@@@. .. . ........ .
|
||||
# .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. ....
|
||||
# .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... ....
|
||||
# @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. ..
|
||||
# .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. .....
|
||||
# ...@@@.... @@@ .@@.......... ........ ..... ..
|
||||
# . ..@@@@.. . .@@@@. .. ....... . .............
|
||||
# . .. .... .. .. . ... ....
|
||||
# . . .... ............. .. ...
|
||||
# .. .. ... ........ ... ...
|
||||
# ................................
|
||||
#
|
||||
# ..
|
||||
# .... ............ ........
|
||||
# . ....... . .... ..
|
||||
# . ... .. .. .. .. ..... . ..
|
||||
# .. .. ....@@@. .. . ........ .
|
||||
# .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. ....
|
||||
# .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... ....
|
||||
# @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. ..
|
||||
# .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. .....
|
||||
# ...@@@.... @@@ .@@.......... ........ ..... ..
|
||||
# . ..@@@@.. . .@@@@. .. ....... . .............
|
||||
# . .. .... .. .. . ... ....
|
||||
# . . .... ............. .. ...
|
||||
# .. .. ... ........ ... ...
|
||||
# ................................
|
||||
#
|
||||
# #############################################################
|
||||
# Intranet.py
|
||||
#
|
||||
# Intranet.py
|
||||
#
|
||||
# Classe Intranet, clase de base de l'intranet
|
||||
#
|
||||
# Copyright (c) 2006 by www.crans.org
|
||||
#
|
||||
# Copyright (c) 2006 by www.crans.org
|
||||
# #############################################################
|
||||
import crans.cp as _crans_cp
|
||||
import cherrypy, os, sys
|
||||
|
@ -35,7 +35,7 @@ class Intranet:
|
|||
# ######################################################## #
|
||||
# GESTION DES MODULES #
|
||||
# ######################################################## #
|
||||
#
|
||||
#
|
||||
#
|
||||
_loaded_modules = {}
|
||||
|
||||
|
@ -53,7 +53,7 @@ class Intranet:
|
|||
# import n'aime pas les chemins absolus !!
|
||||
mon_module = __import__(module_path)
|
||||
module_root = mon_module.main()
|
||||
# on ajoute la classe a l'arborescence de cherrypy :
|
||||
# on ajoute la classe a l'arborescence de cherrypy :
|
||||
setattr( self, un_module, module_root)
|
||||
try:
|
||||
# on ajoute le module aux modules connus
|
||||
|
@ -74,20 +74,20 @@ class Intranet:
|
|||
# ajouter le dossier static ou il faut
|
||||
staticPath = make_path(MODULES_DIR, un_module, "static")
|
||||
if os.path.isdir(staticPath):
|
||||
settings= { self._make_static_path_for_module(un_module):
|
||||
settings= { self._make_static_path_for_module(un_module):
|
||||
{ 'sessionAuthenticateFilter.on': False,
|
||||
'sessionFilter.on': False,
|
||||
'server.output_filters.templatesEngine.on' : False,
|
||||
'staticFilter.on': True,
|
||||
'staticFilter.dir': staticPath,
|
||||
}
|
||||
}
|
||||
}
|
||||
cherrypy.config.update(settings)
|
||||
if cherrypy.config.get("server.environment") == "development":
|
||||
_crans_cp.log("New static : %s" % staticPath)
|
||||
# fin de l'ajout du dossier static
|
||||
_crans_cp.log("New static : %s" % staticPath)
|
||||
# fin de l'ajout du dossier static
|
||||
|
||||
|
||||
|
||||
def __init__(self):
|
||||
##
|
||||
#### import automatique des modules
|
||||
|
@ -105,11 +105,11 @@ class Intranet:
|
|||
else:
|
||||
_crans_cp.log("Pas de dossier de modules", 'LOADING', 2)
|
||||
|
||||
|
||||
|
||||
# ######################################################## #
|
||||
# QUELQUES PAGES #
|
||||
# ######################################################## #
|
||||
#
|
||||
#
|
||||
#
|
||||
def index(self):
|
||||
items = {}
|
||||
|
@ -125,14 +125,14 @@ class Intranet:
|
|||
# si la categorie est vide, on la vire
|
||||
if items[a_category] == {}:
|
||||
del items[a_category]
|
||||
|
||||
|
||||
return {
|
||||
'template':'accueil',
|
||||
'values':{"modules":items},
|
||||
'stylesheets':['css/accueil.css'],
|
||||
}
|
||||
index.exposed= True
|
||||
|
||||
|
||||
def info(self):
|
||||
return {
|
||||
'template':'info-diverses',
|
||||
|
@ -147,7 +147,7 @@ class Intranet:
|
|||
exp = "intranet"
|
||||
dest = cherrypy.config.get("mail.bugreport", "nounous@crans.org")
|
||||
subject = "Rapport de Bug"
|
||||
|
||||
|
||||
# corps du mail
|
||||
text = """
|
||||
Bonsoir,
|
||||
|
@ -155,7 +155,7 @@ Bonsoir,
|
|||
Ceci est un rapport de bug envoye par l'intranet.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
# on recupere tout de suite le traceback
|
||||
tb = crans.utils.exceptions.formatExc()
|
||||
text += "\n= Traceback =\n"
|
||||
|
@ -164,12 +164,12 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
errorString = tb.split("\n")[-2]
|
||||
subject = "[Error] %s" % errorString
|
||||
except: pass
|
||||
|
||||
|
||||
text +="\n= Autres informations =\n"
|
||||
autres_informations = "\n".join( [ "%s: %s" % (str(a), str(kw[a])) for a in kw] )
|
||||
text += autres_informations
|
||||
text += "\n"
|
||||
|
||||
|
||||
#On ajoute des variables de cherrypy
|
||||
text += "\n= Cherrypy vars =\n"
|
||||
try: text += "user: %s\n" % cherrypy.session['uid']
|
||||
|
@ -188,18 +188,18 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
text += "path: %s\n" % cherrypy.request.path
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
#on signe, quand meme !
|
||||
text += "\n-- \nRoot.py pour l'intranet\n"
|
||||
|
||||
text += "\n-- \nRoot.py pour l'intranet\n"
|
||||
|
||||
quickSend(exp, dest, subject, text)
|
||||
return self.index()
|
||||
|
||||
|
||||
send_error_repport.exposed = True
|
||||
|
||||
|
||||
def testErreur(self):
|
||||
raise Exception, "Fausse alerte ! (test du systèmede gestion des erreurs)"
|
||||
|
||||
|
||||
testErreur.exposed = True
|
||||
|
||||
def _cp_on_http_error(self, status, message):
|
||||
|
@ -212,13 +212,13 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
if status==403:
|
||||
cherrypy.response.body = {
|
||||
'template':'error403',
|
||||
'values':{'status':status, 'message':message },
|
||||
'values':{'status':status, 'message':message },
|
||||
'standalone':False,
|
||||
}
|
||||
elif status==404:
|
||||
cherrypy.response.body = {
|
||||
'template':'error',
|
||||
'values':{'status':status, 'message':message },
|
||||
'values':{'status':status, 'message':message },
|
||||
'standalone':False,
|
||||
}
|
||||
elif status==500:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue