Changeset 136:b4891e59a704
- Timestamp:
- 05/05/09 04:43:54 (10 months ago)
- Author:
- Nicolas ?vrard <nicoe@…>
- Branch:
- default
- Message:
-
Removed use of print statements in templates/init.py
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r134
|
r136
|
|
| 21 | 21 | import traceback |
| 22 | 22 | import warnings |
| | 23 | from cStringIO import StringIO |
| 23 | 24 | |
| 24 | 25 | plugins = ['base', 'opendocument', 'pdf', 'chart'] |
| … |
… |
|
| 28 | 29 | __import__('relatorio.templates.%s' % name) |
| 29 | 30 | except Exception, e: |
| 30 | | warnings.warn("Unable to load plugin '%s', you will not be able " |
| 31 | | "to use it" % name) |
| 32 | | print |
| 33 | | print 'Original traceback:' |
| 34 | | print '-------------------' |
| 35 | | traceback.print_exc() |
| 36 | | print |
| | 31 | tb_file = StringIO() |
| | 32 | |
| | 33 | print >> tb_file, ("Unable to load plugin '%s', you will not be able " |
| | 34 | "to use it" % name) |
| | 35 | print >> tb_file |
| | 36 | print >> tb_file, 'Original traceback:' |
| | 37 | print >> tb_file, '-------------------' |
| | 38 | traceback.print_exc(file=tb_file) |
| | 39 | print >> tb_file |
| | 40 | warnings.warn(tb_file.getvalue()) |