From 884f56783f1e6daa421bd69569b30c0a6c7c56a2 Mon Sep 17 00:00:00 2001 From: zhangshine Date: Sat, 6 Jun 2015 17:51:52 +0800 Subject: [PATCH] optimize imports --- pyinvoice/models.py | 10 ++++++++++ pyinvoice/templates.py | 1 + test.py | 2 ++ 3 files changed, 13 insertions(+) diff --git a/pyinvoice/models.py b/pyinvoice/models.py index 5c9de76..4cf52df 100644 --- a/pyinvoice/models.py +++ b/pyinvoice/models.py @@ -2,6 +2,9 @@ from __future__ import unicode_literals class PDFInfo(object): + """ + PDF Properties + """ def __init__(self, title=None, author=None, subject=None): self.title = title self.author = author @@ -77,6 +80,13 @@ class Transaction(object): Transaction information """ def __init__(self, gateway, transaction_id, transaction_datetime, amount): + """ + :param gateway: Payment gateway like Paypal, Stripe etc. + :param transaction_id: + :param transaction_datetime: + :param amount: $$ + :return: + """ self.gateway = gateway self.transaction_id = transaction_id self.transaction_datetime = transaction_datetime diff --git a/pyinvoice/templates.py b/pyinvoice/templates.py index 98cbd9d..d33b972 100644 --- a/pyinvoice/templates.py +++ b/pyinvoice/templates.py @@ -5,6 +5,7 @@ from reportlab.lib.pagesizes import letter from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch from reportlab.platypus import SimpleDocTemplate, Paragraph + from pyinvoice.components import SimpleTable, TableWithHeader, PaidStamp from pyinvoice.models import PDFInfo, Item, Transaction, InvoiceInfo, ServiceProviderInfo, ClientInfo diff --git a/test.py b/test.py index 34c4ad2..b4f0964 100644 --- a/test.py +++ b/test.py @@ -1,8 +1,10 @@ from datetime import datetime from decimal import Decimal + from pyinvoice.models import InvoiceInfo, ServiceProviderInfo, ClientInfo, Item, Transaction from pyinvoice.templates import SimpleInvoice + doc = SimpleInvoice('test.pdf') doc.is_paid = True