Skip to content

Commit

Permalink
Handle constructing a Value from another Value.
Browse files Browse the repository at this point in the history
When creating a Value from another Value the new value is used and the
stlyes are combined.
  • Loading branch information
tonyroberts committed Dec 1, 2016
1 parent a8fa7db commit 1f07959
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -9,7 +9,7 @@
description="A Python package to ease writing tables of data to Excel",
packages=find_packages(),
test_suite="nose.collector",
version="0.2.9",
version="0.2.10",
install_requires=["pandas>=0.12.0"],
extras_require={
"xlsxwriter": ["xlsxwriter>=0.7.2"],
Expand Down
4 changes: 4 additions & 0 deletions xltable/table.py
Expand Up @@ -16,6 +16,10 @@ class Value(object):
:param xltable.CellStyle: Style to be applied to the cell.
"""
def __init__(self, value, style=None):
if isinstance(value, Value):
if value.style:
style = value.style + style if style else value.style
value = value.value
self.value = value
self.style = style

Expand Down

0 comments on commit 1f07959

Please sign in to comment.