From 67bb548a6280f600c215ebc9de7cf1b58bf56947 Mon Sep 17 00:00:00 2001 From: zhangshine Date: Mon, 8 Jun 2015 23:15:36 +0800 Subject: [PATCH] setup.py --- README.md => README.rst | 0 pyinvoice/templates.py | 4 ++-- requirements-dev.txt | 1 + setup.py | 38 ++++++++++++++++++++++++++++++++++++++ test.py => simple.py | 4 ++-- tests/__init__.py | 1 + tests/test_templates.py | 0 7 files changed, 44 insertions(+), 4 deletions(-) rename README.md => README.rst (100%) create mode 100644 requirements-dev.txt create mode 100644 setup.py rename test.py => simple.py (93%) create mode 100644 tests/__init__.py create mode 100644 tests/test_templates.py diff --git a/README.md b/README.rst similarity index 100% rename from README.md rename to README.rst diff --git a/pyinvoice/templates.py b/pyinvoice/templates.py index d33b972..68fba72 100644 --- a/pyinvoice/templates.py +++ b/pyinvoice/templates.py @@ -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): diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..5bf8348 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1 @@ +reportlab diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..7469476 --- /dev/null +++ b/setup.py @@ -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', + ], +) \ No newline at end of file diff --git a/test.py b/simple.py similarity index 93% rename from test.py rename to simple.py index b4f0964..6b457ba 100644 --- a/test.py +++ b/simple.py @@ -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'))) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..6869f25 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +__author__ = 'zhangshine' diff --git a/tests/test_templates.py b/tests/test_templates.py new file mode 100644 index 0000000..e69de29