[reportlab-users] NameError: global name 'get_stylesheets' is not defined
Brandon Rich
brich at caseta.com
Wed Feb 13 12:24:03 EST 2008
Can anyone help me out as to why im getting this error?
Thanks in advance
class createPDF():
def get_stylesheets(self):
sheets = styles.getSampleStyleSheet()
sheets['Normal'].fontSize = STYLESHEET_FONT_SIZE
sheets['Normal'].leading = STYLESHEET_LEADING
sheets['Normal'].spaceAfter = STYLESHEET_SPACE_AFTER
return(sheets)
def create_letter(output_file, template_data):
paragraphStyle = get_stylesheets()['Normal']
xmlHandler = createPDFContent(paragraphStyle)
xmlData = StringIO(template_data)
parse(xmlData, xmlHandler)
pdfDoc = initializePDF()
doc = pdfDoc.createDoc(output_file, xmlHandler.content)
return (doc)
File "C:\workspace\pythonlibs\tests\document\CreateViolationPDF.py",
line 15, in <module>
class createViolationPDF():
File "C:\workspace\pythonlibs\tests\document\CreateViolationPDF.py",
line 53, in createViolationPDF
create_letter(letters_file, t)
File "C:\workspace\pythonlibs\tests\document\CreateViolationPDF.py",
line 38, in create_letter
paragraphStyle = get_stylesheets()['Normal']
NameError: global name 'get_stylesheets' is not defined
More information about the reportlab-users
mailing list