Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolina Sotirova committed Jul 29, 2013
1 parent 2b9469e commit ae79c69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions backdrop/core/parse_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def _extract_values(row, book):

def _extract_cell_value(cell, book):
if cell.ctype == 3:
return utc(datetime.datetime(*xlrd.xldate_as_tuple(cell.value, book.datemode)))
time_tuple = xlrd.xldate_as_tuple(cell.value, book.datemode)
return utc(datetime.datetime(*time_tuple))
elif cell.ctype == 5:
raise ParseError("Error encountered in cell")
return cell.value
return cell.value
3 changes: 1 addition & 2 deletions tests/core/test_parse_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def test_parse_an_xlsx_file(self):
{"name": "Pawel", "age": 27, "nationality": "Polish"},
{"name": "Max", "age": 35, "nationality": "Italian"}))


def test_parse_xlsx_dates(self):
assert_that(self._parse_excel("dates.xlsx"),
only_contains(
Expand All @@ -31,4 +30,4 @@ def test_parse_xls_file(self):
{"date": d_tz(2013, 12, 4), "name": "test2", "number": 34}))

def test_parse_xlsx_with_error(self):
self.assertRaises(ParseError, self._parse_excel, "error.xlsx")
self.assertRaises(ParseError, self._parse_excel, "error.xlsx")
2 changes: 1 addition & 1 deletion tests/support/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ def d(year, month, day, hour=0, minute=0, second=0):


def fixture_path(name):
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'features', 'fixtures', name))
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'features', 'fixtures', name))

0 comments on commit ae79c69

Please sign in to comment.