Skip to content

Commit

Permalink
resolves #337 by adding epilogue argument
Browse files Browse the repository at this point in the history
  • Loading branch information
alimanfoo committed Dec 4, 2015
1 parent a564493 commit 1ec1f0e
Show file tree
Hide file tree
Showing 4 changed files with 808 additions and 706 deletions.
2 changes: 1 addition & 1 deletion optional_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Cython==0.23.4
numpy==1.10.1
numexpr==2.4.6
bcolz==0.12.0
bcolz==0.12.1
tables==3.2.2
intervaltree==2.1.0
lxml==3.5.0
Expand Down
15 changes: 10 additions & 5 deletions petl/util/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ def _vis_overflow(table, limit):


def _display_html(table, limit=0, vrepr=None, index_header=None, caption=None,
tr_style=None, td_styles=None, encoding=None, truncate=None):
tr_style=None, td_styles=None, encoding=None,
truncate=None, epilogue=None):

# determine defaults
if limit == 0:
Expand All @@ -552,7 +553,9 @@ def _display_html(table, limit=0, vrepr=None, index_header=None, caption=None,
td_styles=td_styles, truncate=truncate)
output = text_type(buf.getvalue(), encoding)

if overflow:
if epilogue:
output += '<p>%s</p>' % epilogue
elif overflow:
output += '<p><strong>...</strong></p>'

return output
Expand All @@ -562,17 +565,19 @@ def _display_html(table, limit=0, vrepr=None, index_header=None, caption=None,


def display(table, limit=0, vrepr=None, index_header=None, caption=None,
tr_style=None, td_styles=None, encoding=None, truncate=None):
tr_style=None, td_styles=None, encoding=None, truncate=None,
epilogue=None):
"""
Display a table inline within an IPython notebook.
"""

from IPython.core.display import display_html
html = _display_html(table, limit=limit, vrepr=vrepr,
index_header=index_header, caption=caption,
tr_style=tr_style, td_styles=td_styles,
encoding=encoding, truncate=truncate)
encoding=encoding, truncate=truncate,
epilogue=epilogue)
display_html(html, raw=True)


Expand Down
Loading

0 comments on commit 1ec1f0e

Please sign in to comment.