Commit 2b64c4e1 authored by Sandro Tosi's avatar Sandro Tosi

Initial release (Closes: #530704)

parent 33aa44f8
prettytable (0.5-1) unstable; urgency=low
prettytable (0.5-1) UNRELEASED; urgency=low
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
* Initial release (Closes: #530704)
-- Sandro Tosi <morph@debian.org> Wed, 27 May 2009 08:06:55 +0200
-- Sandro Tosi <morph@debian.org> Wed, 27 May 2009 08:33:46 +0200
Source: prettytable
Section: unknown
Priority: extra
Maintainer: Sandro Tosi <morph@debian.org>
Build-Depends: debhelper (>= 7)
Section: python
Priority: optional
Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Uploaders: Sandro Tosi <morph@debian.org>
Build-Depends: debhelper (>= 7), python
Build-Depends-Indep: python-support (>= 1.0.0)
Standards-Version: 3.8.1
Homepage: <insert the upstream URL, if relevant>
Homepage: http://code.google.com/p/prettytable/
Vcs-Svn: svn://svn.debian.org/python-modules/packages/prettytable/trunk/
Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/prettytable/trunk/
Package: prettytable
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
Package: python-prettytable
Architecture: all
Depends: ${python:Depends}, ${misc:Depends}
Description: library to represent tabular data in visually appealing ASCII tables
PrettyTable is a simple Python library designed to make it quick and
easy to represent tabular data in visually appealing ASCII tables. It
was inspired by the ASCII tables used in the PostgreSQL shell
psql. PrettyTable allows for selection of which columns are to be
printed, independent alignment of columns (left or right justified or
centred) and printing of "sub-tables" by specifying a row range.
This package was debianized by Sandro Tosi <morph@debian.org> on
Wed, 27 May 2009 08:06:55 +0200.
It was downloaded from <url://example.com>
It was downloaded from http://code.google.com/p/prettytable/
Upstream Author(s):
Upstream Author:
<put author's name and email here>
<likewise for another author>
Luke Maurits <luke@maurits.id.au>
Copyright:
<Copyright (C) YYYY Name OfAuthor>
<likewise for another author>
Copyright (c) 2009, Luke Maurits <luke@maurits.id.au>
License:
<Put the license of the package here indented by 4 spaces>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
The Debian packaging is:
Copyright (C) 2009 Sandro Tosi <morph@debian.org>
and is licensed under the GPL version 3,
see `/usr/share/common-licenses/GPL-3'.
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
and is licensed under the same terms as upstream code
debian/prettytable-example.py
#!/usr/bin/python
# Example extracted from the source code of prettytable module
def main():
x = PrettyTable(["City name", "Area", "Population", "Annual Rainfall"])
x.set_field_align("City name", "l") # Left align city names
x.add_row(["Adelaide",1295, 1158259, 600.5])
x.add_row(["Brisbane",5905, 1857594, 1146.4])
x.add_row(["Darwin", 112, 120900, 1714.7])
x.add_row(["Hobart", 1357, 205556, 619.5])
x.add_row(["Sydney", 2058, 4336374, 1214.8])
x.add_row(["Melbourne", 1566, 3806092, 646.9])
x.add_row(["Perth", 5386, 1554769, 869.4])
print x
if len(sys.argv) > 1 and sys.argv[1] == "test":
# This "test suite" is hideous and provides poor, arbitrary coverage.
# I'll replace it with some proper unit tests Sometime Soon (TM).
# Promise.
print "Testing field subset selection:"
x.printt(fields=["City name","Population"])
print "Testing row subset selection:"
x.printt(start=2, end=5)
print "Testing hrules settings:"
print "FRAME:"
x.printt(hrules=FRAME)
print "ALL:"
x.printt(hrules=ALL)
print "NONE:"
x.printt(hrules=NONE)
print "Testing lack of headers:"
x.printt(header=False)
x.printt(header=False, border=False)
print "Testing lack of borders:"
x.printt(border=False)
print "Testing sorting:"
x.printt(sortby="City name")
x.printt(sortby="Annual Rainfall")
x.printt(sortby="Annual Rainfall", reversesort=True)
print "Testing padding parameter:"
x.set_padding_width(0)
x.printt()
x.set_padding_width(5)
x.printt()
x.set_left_padding(5)
x.set_right_padding(0)
x.printt()
x.set_right_padding(20)
x.printt()
x.set_left_padding(None)
x.set_right_padding(None)
x.set_padding_width(2)
print "Testing changing characters"
x.set_border_chars("*","*","*")
x.printt()
x.set_border_chars("!","~","o")
x.printt()
x.set_border_chars("|","-","+")
print "Testing everything at once:"
x.printt(start=2, end=5, fields=["City name","Population"], border=False, hrules=True)
print "Rebuilding by columns:"
x = PrettyTable()
x.add_column("City name", ["Adelaide", "Brisbane", "Darwin", "Hobart", "Sydney", "Melbourne", "Perth"])
x.add_column("Area", [1295, 5905, 112, 1357, 2058, 1566, 5385])
x.add_column("Population", [1158259, 1857594, 120900, 205556, 4336374, 3806092, 1554769])
x.add_column("Annual Rainfall", [600.5, 1146.4, 1714.7, 619.5, 1214.8, 646.9, 869.4])
x.printt()
print "Testing HTML:"
x.print_html()
x.print_html(border=False)
x.print_html(border=True)
x.print_html(format=False)
x.print_html(attributes={"name": "table", "id": "table"})
if __name__ == "__main__":
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment