I have below one class vuln.py
from reportlab.graphics.shapes import Drawing, String, Rect
class vuln(Drawing):
def __init__(self, width=300, height=150, report_type=None, *args, **kw):
Drawing.__init__(self, width, height, *args, **kw)
self.report_type = report_type
def print_report(self):
print self.report_type
and calling program rep.py
import vuln
obj = vuln.vuln(report_type="abc")
obj.print_report()
After executing this it gives error,
Traceback (most recent call last):
File "rep.py", line 3, in <module>
obj = vuln.vuln(report_type="abc")
File "/data/support/vuln.py", line 5, in __init__
self.report_type = report_type
File "/usr/lib64/python2.6/site-packages/reportlab/graphics/shapes.py", line 359, in __setattr__
validateSetattr(self,attr,value) #from reportlab.lib.attrmap
File "/usr/lib64/python2.6/site-packages/reportlab/lib/attrmap.py", line 118, in validateSetattr
raise AttributeError, "Illegal attribute '%s' in class %s" % (name, obj.__class__.__name__)
AttributeError: Illegal attribute 'report_type' in class vuln
Please help to know what the error is all about.