Skip to content

Commit

Permalink
Merge 8d1ae55 into cb78701
Browse files Browse the repository at this point in the history
  • Loading branch information
whart222 committed Apr 7, 2019
2 parents cb78701 + 8d1ae55 commit edcc9a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: python
matrix:
include:
- python: '2.6'
env: PYRO="Pyro" YAML="pyyaml"
- python: '2.7'
env: PYRO="Pyro" YAML="pyyaml"
#- python: '2.7'
Expand All @@ -22,11 +20,6 @@ matrix:
install:
- if [ -n "${JYTHON}" ]; then source install_jython.sh; fi
- if [ -n "${YAML}" ]; then pip install pyyaml; fi
- if [ "${TRAVIS_PYTHON_VERSION}" = "2.6" ]; then pip install ordereddict; fi
- if [ "${TRAVIS_PYTHON_VERSION}" = "2.6" ]; then pip install pbr; fi
- if [ "${TRAVIS_PYTHON_VERSION}" = "2.6" ]; then pip install linecache2; fi
- if [ "${TRAVIS_PYTHON_VERSION}" = "2.6" ]; then pip install traceback2; fi
- if [ "${TRAVIS_PYTHON_VERSION}" != "2.6" ]; then pip install openpyxl; fi
- pip install xlrd
- pip install $PYRO
- pip install coverage
Expand Down
9 changes: 4 additions & 5 deletions pyutilib/excel/spreadsheet_openpyxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ def open(self, filename, worksheets=(1,), default_worksheet=1):
with warnings.catch_warnings():
warnings.simplefilter("ignore")
self.wb = openpyxl.load_workbook(self.xlsfile)
self.worksheets = self.wb.get_sheet_names()
self.worksheets = self.wb.sheetnames
self._ws = {}
for wsid in worksheets:
self._ws[wsid] = self.wb.get_sheet_by_name(self.worksheets[wsid -
1])
self._ws[wsid] = self.wb[self.worksheets[wsid - 1]]
self.default_worksheet = default_worksheet

def ws(self):
Expand Down Expand Up @@ -136,7 +135,7 @@ def get_array(self, row, col, row2, col2, wsid=None, raw=False):
self.activate(wsid)
ws = self.wb.active
ans = []
for row in ws.get_squared_range(row, col, row2, col2):
for row in ws.iter_rows(min_col=col, min_row=row, max_col=col2, max_row=row2):
ans_ = []
for col in row:
ans_.append(col.value)
Expand Down Expand Up @@ -285,7 +284,7 @@ def _range(self, rangeid, wsid=None, exception=True):
# Otherwise, we assume that this is a range name.
#
try:
return self.wb.get_named_range(rangeid)
return self.wb.defined_names[rangeid]
except KeyError:
pass
ws = self.wb.active
Expand Down

0 comments on commit edcc9a7

Please sign in to comment.