scripts/lib/cp.py
Vincent Le Gallic c039058708 Enregistrement des droits d'exécution. Aucune vraie modif.
Darcs n'enregistrait pas les permissions des fichiers.
2013-01-31 05:36:25 +01:00

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)