From f8321add2c2b58905e9c235d67ac28278053cb9e Mon Sep 17 00:00:00 2001 From: chfw Date: Sun, 7 Dec 2014 14:13:34 +0000 Subject: [PATCH] interface update --- README.rst | 12 ++++++------ pyexcel_xls/__init__.py | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 457589d..ff3f530 100644 --- a/README.rst +++ b/README.rst @@ -53,7 +53,7 @@ Write to an xls file >>> from pyexcel.ext.xls import OrderedDict -Here's the sample code to write a dictionary to an xl file:: +Here's the sample code to write a dictionary to an xls file:: >>> from pyexcel_xls import XLWriter >>> data = OrderedDict() # from collections import OrderedDict @@ -81,7 +81,7 @@ Here's the sample code:: Write an xls to memory ********************** -Here's the sample code to write a dictionary to an xl file:: +Here's the sample code to write a dictionary to an xls file:: >>> from pyexcel_xls import XLWriter >>> data = OrderedDict() @@ -102,7 +102,7 @@ Read from an xls from memory Continue from previous example:: >>> # This is just an illustration - >>> # In reality, you might deal with xl file upload + >>> # In reality, you might deal with xls file upload >>> # where you will read from requests.FILES['YOUR_XL_FILE'] >>> book = XLBook(None, io.getvalue()) >>> print(json.dumps(book.sheets())) @@ -118,7 +118,7 @@ Import it in your file to enable this plugin:: Please note only pyexcel version 0.0.4+ support this. -Reading from an xl file +Reading from an xls file ************************ Here is the sample code:: @@ -140,7 +140,7 @@ Here is the sample code:: | row 1 | row 2 | row 3 | +-------+-------+-------+ -Writing to an xl file +Writing to an xls file ********************** Here is the sample code:: @@ -153,7 +153,7 @@ Reading from a IO instance You got to wrap the binary content with stream to get xls working:: >>> # This is just an illustration - >>> # In reality, you might deal with xl file upload + >>> # In reality, you might deal with xls file upload >>> # where you will read from requests.FILES['YOUR_XL_FILE'] >>> xlfile = "another_file.xls" >>> with open(xlfile, "rb") as f: diff --git a/pyexcel_xls/__init__.py b/pyexcel_xls/__init__.py index f558237..a3c1bc0 100644 --- a/pyexcel_xls/__init__.py +++ b/pyexcel_xls/__init__.py @@ -56,7 +56,10 @@ class XLSheet(SheetReader): """ def __init__(self, sheet): SheetReader.__init__(self, sheet) - self.name = sheet.name + + @property + def name(self): + return self.native_sheet.name def number_of_rows(self): """