This commit is contained in:
zhangshine 2015-06-08 23:15:36 +08:00
parent 884f56783f
commit 67bb548a62
7 changed files with 44 additions and 4 deletions

View file

@ -82,14 +82,14 @@ class SimpleInvoice(SimpleDocTemplate):
def __build_invoice_info(self):
if isinstance(self.invoice_info, InvoiceInfo):
self._story.append(
Paragraph('Invoice', self._defined_styles.get('Heading1'))
Paragraph('Invoice', self._defined_styles.get('RightHeading1'))
)
props = [('invoice_id', 'Invoice id'), ('invoice_datetime', 'Invoice date'),
('due_datetime', 'Invoice due date')]
self._story.append(
SimpleTable(self.__attribute_to_table_data(self.invoice_info, props), horizontal_align='LEFT')
SimpleTable(self.__attribute_to_table_data(self.invoice_info, props), horizontal_align='RIGHT')
)
def __build_service_provider_info(self):

1
requirements-dev.txt Normal file
View file

@ -0,0 +1 @@
reportlab

38
setup.py Normal file
View file

@ -0,0 +1,38 @@
#!/usr/bin/env python
from distutils.core import setup, Extension, Command
import os
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='PyInvoice',
version='0.1.0',
packages=['pyinvoice'],
include_package_data=True,
license='MIT License',
description='Invoice/Receipt generator',
long_description=README,
url='https://github.com/CiCiApp/PyInvoice',
author='zhangshine',
author_email='zhangshine0125@gmail.com',
install_requires=['reportlab'],
test_suite='tests',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)

View file

@ -17,7 +17,7 @@ doc.service_provider_info = ServiceProviderInfo(
city='My City',
state='My State',
country='My Country',
post_code='My Post code'
post_code='222222'
)
doc.client_info = ClientInfo(
@ -28,7 +28,7 @@ doc.client_info = ClientInfo(
city='Client City',
state='Client State',
country='Client country',
post_code='Client Post code'
post_code='222222'
)
doc.add_item(Item('0000', 'Item 0000', 'Item Description 1 Long--------------------------------Item Description 1 Long', 1, Decimal('1.1')))

1
tests/__init__.py Normal file
View file

@ -0,0 +1 @@
__author__ = 'zhangshine'

0
tests/test_templates.py Normal file
View file