#!/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 = "[%s] %s" % ( login, string ) except: pass cherrypy.log(string, keyword, level)