Skip to content

Commit 7332137

Browse files
committed
pep8 styling
1 parent 6fd5efe commit 7332137

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

pyexcel_xlsx/__init__.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
else:
1616
from io import BytesIO as StringIO
1717

18+
1819
COLUMNS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
1920
COLUMN_LENGTH = 26
2021

22+
2123
def get_columns(index):
2224
if index < COLUMN_LENGTH:
2325
return COLUMNS[index]
2426
else:
25-
return get_columns(int(index/COLUMN_LENGTH)) + COLUMNS[index%COLUMN_LENGTH]
26-
27+
return (get_columns(int(index / COLUMN_LENGTH)) +
28+
COLUMNS[index % COLUMN_LENGTH])
29+
2730

2831
class XLSXSheet(SheetReader):
2932
"""
@@ -50,7 +53,9 @@ def cell_value(self, row, column):
5053
Random access to the xls cells
5154
"""
5255
actual_row = row + 1
53-
return self.native_sheet.cell("%s%d" % (get_columns(column), actual_row)).value
56+
cell_location = "%s%d" % (get_columns(column), actual_row)
57+
return self.native_sheet.cell(cell_location).value
58+
5459

5560
class XLSXBook(BookReader):
5661
"""
@@ -84,7 +89,8 @@ def write_row(self, array):
8489
write a row into the file
8590
"""
8691
for i in range(0, len(array)):
87-
self.native_sheet.cell("%s%d" % (get_columns(i), self.current_row)).value = array[i]
92+
cell_location = "%s%d" % (get_columns(i), self.current_row)
93+
self.native_sheet.cell(cell_location).value = array[i]
8894
self.current_row += 1
8995

9096

@@ -100,9 +106,11 @@ def __init__(self, file, **keywords):
100106
def create_sheet(self, name):
101107
if self.current_sheet == 0:
102108
self.current_sheet = 1
103-
return XLSXSheetWriter(self.native_book, self.native_book.active, name)
109+
return XLSXSheetWriter(self.native_book,
110+
self.native_book.active, name)
104111
else:
105-
return XLSXSheetWriter(self.native_book, self.native_book.create_sheet(), name)
112+
return XLSXSheetWriter(self.native_book,
113+
self.native_book.create_sheet(), name)
106114

107115
def close(self):
108116
"""
@@ -126,4 +134,4 @@ def close(self):
126134
# to allow this module to function independently
127135
pass
128136

129-
__VERSION__ = "0.0.1"
137+
__VERSION__ = "0.0.2"

0 commit comments

Comments
 (0)