41 lines
1.5 KiB
Python
41 lines
1.5 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: iso-8859-15 -*-
|
|
# #############################################################
|
|
# ..
|
|
# .... ............ ........
|
|
# . ....... . .... ..
|
|
# . ... .. .. .. .. ..... . ..
|
|
# .. .. ....@@@. .. . ........ .
|
|
# .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. ....
|
|
# .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... ....
|
|
# @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. ..
|
|
# .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. .....
|
|
# ...@@@.... @@@ .@@.......... ........ ..... ..
|
|
# . ..@@@@.. . .@@@@. .. ....... . .............
|
|
# . .. .... .. .. . ... ....
|
|
# . . .... ............. .. ...
|
|
# .. .. ... ........ ... ...
|
|
# ................................
|
|
#
|
|
# #############################################################
|
|
"""
|
|
cp.py
|
|
|
|
Fonctions pour cherrypy (intranet)
|
|
|
|
Copyright (c) 2006 by www.crans.org
|
|
"""
|
|
import cherrypy
|
|
|
|
def log(string, keyword = "INTRANET", level = 0):
|
|
"""Utilise la fonction log de cherrypy avec quelques modification
|
|
|
|
-> introduit le login de la session en cours s'il existe
|
|
"""
|
|
try:
|
|
login = cherrypy.session['uid']
|
|
string = u"[%s] %s" % ( login, string )
|
|
except:
|
|
pass
|
|
string = string.encode("utf-8")
|
|
cherrypy.log(string, keyword, level)
|