~stephane-openerp/openobject-server/python_lib

« back to all changes in this revision

Viewing changes to bin/addons/base/ir/workflow/print_instance.py

  • Committer: Stephane Wirtel
  • Date: 2010-01-31 21:49:48 UTC
  • Revision ID: stephane@openerp.com-20100131214948-a3p93d5ml7tir1f0
[REF] Extract the Logger class from the netsvc module

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import time, os
23
23
 
24
 
import netsvc
 
24
import logger
25
25
import report,pooler,tools
26
26
 
27
27
 
109
109
 
110
110
class report_graph_instance(object):
111
111
    def __init__(self, cr, uid, ids, data):
112
 
        logger = netsvc.Logger()
 
112
        log = logger.Logger()
113
113
        try:
114
114
            import pydot
115
115
        except Exception,e:
116
 
            logger.notifyChannel('workflow', netsvc.LOG_WARNING,
 
116
            log.notifyChannel('workflow', logger.LOG_WARNING,
117
117
                    'Import Error for pydot, you will not be able to render workflows\n'
118
118
                    'Consider Installing PyDot or dependencies: http://dkbza.org/pydot.html')
119
119
            raise e
153
153
        except Exception, e:
154
154
            import traceback, sys
155
155
            tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
156
 
            logger.notifyChannel('workflow', netsvc.LOG_ERROR, 'Exception in call: ' + tb_s)
 
156
            log.notifyChannel('workflow', logger.LOG_ERROR, 'Exception in call: ' + tb_s)
157
157
            # string is in PS, like the success message would have been
158
158
            ps_string = '''%PS-Adobe-3.0
159
159
/inch {72 mul} def