Commit 574a94cb authored by Tristan Cavelier's avatar Tristan Cavelier

logging

parent ceb82c83
......@@ -42,6 +42,10 @@ from fnmatch import fnmatch
from cloudooo.handler.ooo.granulator import OOGranulator
from cloudooo.handler.ooo.mimemapper import mimemapper
def log(s):
import os
os.system("{ date | head -c -1 ; echo '%s' ; } >> ~/tmp/tristan.log" % s.replace("'", r"'\''"))
class HandlerNotFound(Exception):
pass
......@@ -227,7 +231,9 @@ class Manager(object):
output_mimetype_set = set()
for handler, mimetype_filter_list in handler_dict.items():
#log("TRISTAN handler %r" % (handler,))
for output_mimetype in self.handler_dict[handler].getAllowedConversionFormatList(source_mimetype):
#log("TRISTAN output_mimetype %r" % (output_mimetype,))
for mimetype_filter in mimetype_filter_list:
if fnmatch(output_mimetype[0], mimetype_filter):
output_mimetype_set.add(output_mimetype)
......@@ -342,6 +348,7 @@ class Manager(object):
This is a Backwards compatibility provided for ERP5 Project, in order to
keep compatibility with OpenOffice.org Daemon.
"""
#log("TRISTAN atil")
response_dict = {}
try:
mimetype_list = self.getAllowedConversionFormatList(content_type)
......@@ -354,6 +361,8 @@ class Manager(object):
return (200, response_dict, '')
except Exception, e:
logger.error(e)
import traceback
log("TRISTAN %s" % traceback.format_exc())
return (402, {}, e.args[0])
def _getOOGranulator(self, data, source_format="odt"):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment