summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKane Blueriver <kxxoling@gmail.com>2015-05-28 21:10:36 +0800
committerKane Blueriver <kxxoling@gmail.com>2015-05-28 21:11:50 +0800
commit370727edc74f34ed13db7ef41526e74028870023 (patch)
treec00ddd1140cca2740e2b7172d259d3aa230cd584
parent1753bc4f56e22a0ee1ff2cf54efdb8c827aab884 (diff)
downloadpython-prettytable-ptable-370727edc74f34ed13db7ef41526e74028870023.tar.gz
Update long description; add support for unix pipe; update version number;
-rw-r--r--prettytable/__init__.py6
-rw-r--r--prettytable/cli.py8
2 files changed, 11 insertions, 3 deletions
diff --git a/prettytable/__init__.py b/prettytable/__init__.py
index cde4eb0..ac2cb37 100644
--- a/prettytable/__init__.py
+++ b/prettytable/__init__.py
@@ -4,8 +4,8 @@
# * Chris Clark
# * Klein Stephane
# * John Filleau
-# PTable forked from original Google Code page in 2015.4, and is maintained
-# by Kane Blueriver <kxxoling@gmail.com>.
+# PTable is forked from original Google Code page in April, 2015, and now
+# maintained by Kane Blueriver <kxxoling@gmail.com>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -30,7 +30,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-__version__ = "0.9.0"
+__version__ = "0.9.2"
from .prettytable import PrettyTable
from .prettytable import ALL, HEADER, MSWORD_FRIENDLY, NONE
diff --git a/prettytable/cli.py b/prettytable/cli.py
index 95b5a90..5ab7781 100644
--- a/prettytable/cli.py
+++ b/prettytable/cli.py
@@ -1,9 +1,17 @@
from __future__ import print_function
import argparse
+import sys
+
from .factory import from_csv
+from ._compact import StringIO
def main():
+ text_in = sys.stdin.read()
+ if text_in:
+ print(from_csv(StringIO.StringIO(text_in)))
+ return
+
parser = argparse.ArgumentParser(description='A simple Python library designed to make it quick and easy to '
'represent tabular data in visually appealing ASCII tables.')
parser.add_argument('--csv', help='CSV file name')