28 from copy import deepcopy, copy |
28 from copy import deepcopy, copy |
29 from reportlab.lib.colors import red, gray, lightgrey |
29 from reportlab.lib.colors import red, gray, lightgrey |
30 from reportlab.lib.rl_accel import fp_str |
30 from reportlab.lib.rl_accel import fp_str |
31 from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY |
31 from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY |
32 from reportlab.lib.styles import _baseFontName |
32 from reportlab.lib.styles import _baseFontName |
33 from reportlab.lib.utils import strTypes |
33 from reportlab.lib.utils import strTypes, safer_globals |
34 from reportlab.lib.abag import ABag |
34 from reportlab.lib.abag import ABag |
35 from reportlab.pdfbase import pdfutils |
35 from reportlab.pdfbase import pdfutils |
36 from reportlab.pdfbase.pdfmetrics import stringWidth |
36 from reportlab.pdfbase.pdfmetrics import stringWidth |
37 from reportlab.rl_config import _FUZZ, overlapAttachedSpace, ignoreContainerActions, listWrapOnFakeWidth |
37 from reportlab.rl_config import _FUZZ, overlapAttachedSpace, ignoreContainerActions, listWrapOnFakeWidth |
38 from reportlab import xrange |
38 from reportlab import xrange |
753 def __repr__(self): |
753 def __repr__(self): |
754 return "Macro(%s)" % repr(self.command) |
754 return "Macro(%s)" % repr(self.command) |
755 def wrap(self, availWidth, availHeight): |
755 def wrap(self, availWidth, availHeight): |
756 return (0,0) |
756 return (0,0) |
757 def draw(self): |
757 def draw(self): |
758 exec(self.command, globals(), {'canvas':self.canv}) |
758 exec(self.command, safer_globals(), {'canvas':self.canv}) |
759 |
759 |
760 def _nullCallable(*args,**kwds): |
760 def _nullCallable(*args,**kwds): |
761 pass |
761 pass |
762 |
762 |
763 class CallerMacro(Flowable): |
763 class CallerMacro(Flowable): |