Rapports de bug plus concis et plus utils (j'espère)
darcs-hash:20070613135956-f46e9-a57be9ae11383814f2f489629221094f49362262.gz
This commit is contained in:
parent
25a25e3cad
commit
a2e651c36e
1 changed files with 21 additions and 17 deletions
|
@ -143,30 +143,39 @@ class Intranet:
|
||||||
|
|
||||||
def send_error_repport(self, **kw):
|
def send_error_repport(self, **kw):
|
||||||
|
|
||||||
# on recupere tout de suite le traceback
|
|
||||||
tb = crans.utils.exceptions.formatExc()
|
|
||||||
# entetes du mail
|
# entetes du mail
|
||||||
exp = "intranet"
|
exp = "intranet"
|
||||||
dest = cherrypy.config.get("mail.bugreport", "nounous@crans.org")
|
dest = cherrypy.config.get("mail.bugreport", "nounous@crans.org")
|
||||||
subject = "Rapport de Bug"
|
subject = "Rapport de Bug"
|
||||||
|
|
||||||
|
# corps du mail
|
||||||
text = """
|
text = """
|
||||||
Bonsoir,
|
Bonsoir,
|
||||||
|
|
||||||
Ceci est un rapport de bug envoye par l'intranet.
|
Ceci est un rapport de bug envoye par l'intranet.
|
||||||
|
|
||||||
%s
|
"""
|
||||||
""" % "\n".join( [ "%s: %s" % (str(a), str(kw[a])) for a in kw] )
|
|
||||||
|
# on recupere tout de suite le traceback
|
||||||
|
tb = crans.utils.exceptions.formatExc()
|
||||||
|
text += "\n= Traceback =\n"
|
||||||
|
text += tb
|
||||||
|
|
||||||
|
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
|
#On ajoute des variables de cherrypy
|
||||||
text += "\n= Cherrypy vars =\n"
|
text += "\n= Cherrypy vars =\n"
|
||||||
try:
|
try: text += "user: %s\n" % cherrypy.session['uid']
|
||||||
text += "url: %s\n" % cherrypy.request.browser_url
|
except: text += "user: <n/a>\n"
|
||||||
except:
|
try: text += "url: %s\n" % cherrypy.request.browser_url
|
||||||
pass
|
except: text += "url: <n/a>\n"
|
||||||
try:
|
#try:
|
||||||
text += "headers: \n %s\n" % "\n".join( [" %s: %s" % (str(a), str(cherrypy.request.headers[a])) for a in cherrypy.request.headers] )
|
# text += "headers: \n %s\n" % "\n".join( [" %s: %s" % (str(a), str(cherrypy.request.headers[a])) for a in cherrypy.request.headers] )
|
||||||
except:
|
#except:
|
||||||
pass
|
# pass
|
||||||
try:
|
try:
|
||||||
text += "query_string: %s\n" % cherrypy.request.query_string
|
text += "query_string: %s\n" % cherrypy.request.query_string
|
||||||
except:
|
except:
|
||||||
|
@ -176,11 +185,6 @@ Ceci est un rapport de bug envoye par l'intranet.
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# on ajoute le traceback
|
|
||||||
text += "\n= Traceback =\n"
|
|
||||||
text += tb
|
|
||||||
|
|
||||||
#on signe, quand meme !
|
#on signe, quand meme !
|
||||||
text += "\n-- \nRoot.py pour l'intranet\n"
|
text += "\n-- \nRoot.py pour l'intranet\n"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue