From 6fbce729b4b23b80cc82c997b7b8ed313bdce388 Mon Sep 17 00:00:00 2001 From: zhangshine Date: Wed, 27 May 2015 17:35:13 +0800 Subject: [PATCH] general componenets --- pyinvoice/components.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pyinvoice/components.py diff --git a/pyinvoice/components.py b/pyinvoice/components.py new file mode 100644 index 0000000..4966333 --- /dev/null +++ b/pyinvoice/components.py @@ -0,0 +1,15 @@ +from reportlab.platypus import Paragraph, Table +from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet +from reportlab.lib import colors + + +class CodeSnippet(Paragraph): + style = ParagraphStyle( + name='CodeSnippet', + parent=getSampleStyleSheet()['Code'], + backColor=colors.lightgrey, leftIndent=0, + borderPadding=(5, 5, 5, 5) + ) + + def __init__(self, code): + Paragraph.__init__(self, code, self.style) \ No newline at end of file