All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bird, Timothy" <Tim.Bird@sony.com>
To: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>,
	"fuego@lists.linuxfoundation.org"
	<fuego@lists.linuxfoundation.org>
Subject: Re: [Fuego] [PATCH 1/2] LTP:ltp_process: dont crash if no sheets are	generated
Date: Thu, 14 Dec 2017 01:09:01 +0000	[thread overview]
Message-ID: <ECADFF3FD767C149AD96A924E7EA6EAF40AE4A2A@USCULXMSG01.am.sony.com> (raw)
In-Reply-To: <1513154537-11933-2-git-send-email-daniel.sangorrin@toshiba.co.jp>

Applied an pushed.

Thanks,
 -- Tim

> -----Original Message-----
> From: fuego-bounces@lists.linuxfoundation.org [mailto:fuego-
> bounces@lists.linuxfoundation.org] On Behalf Of Daniel Sangorrin
> Sent: Wednesday, December 13, 2017 12:42 AM
> To: fuego@lists.linuxfoundation.org
> Subject: [Fuego] [PATCH 1/2] LTP:ltp_process: dont crash if no sheets are
> generated
> 
> This fixes the following error that occurs when running the rtonly spec,
> which does not generate any sheet.
> 
> Traceback (most recent call last):
>   File "ltp_process.py", line 338, in <module>
>     book.save('results.xlsx')
>   File "/usr/lib/pymodules/python2.7/openpyxl/workbook.py", line 232, in
> save
>     save_workbook(self, filename)
>   File "/usr/lib/pymodules/python2.7/openpyxl/writer/excel.py", line 159, in
> save_workbook
>     writer.save(filename)
>   File "/usr/lib/pymodules/python2.7/openpyxl/writer/excel.py", line 142, in
> save
>     self.write_data(archive)
>   File "/usr/lib/pymodules/python2.7/openpyxl/writer/excel.py", line 73, in
> write_data
>     archive.writestr(ARC_WORKBOOK, write_workbook(self.workbook))
>   File "/usr/lib/pymodules/python2.7/openpyxl/writer/workbook.py", line
> 170, in write_workbook
>     SubElement(book_views, 'workbookView', {'activeTab': '%d' %
> workbook.get_index(workbook.get_active_sheet()),
>   File "/usr/lib/pymodules/python2.7/openpyxl/workbook.py", line 124, in
> get_active_sheet
>     return self.worksheets[self._active_sheet_index]
> IndexError: list index out of range
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
> ---
>  engine/tests/Functional.LTP/ltp_process.py | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/engine/tests/Functional.LTP/ltp_process.py
> b/engine/tests/Functional.LTP/ltp_process.py
> index 1658943..867ef7a 100644
> --- a/engine/tests/Functional.LTP/ltp_process.py
> +++ b/engine/tests/Functional.LTP/ltp_process.py
> @@ -88,9 +88,6 @@ def read_output (test_category, test_case):
>  # Open a workbook
>  book = Workbook()
> 
> -# Delete the default sheet
> -book.remove_sheet(book.get_sheet_by_name("Sheet"))
> -
>  # Create style setting before the for loop
>  # This is needed to avoid excel errors (too many font settings)
>  medium_border = Border()
> @@ -334,6 +331,10 @@ if os.path.exists('pts.log'):
>          # last working sheet
>          pts_set_style(ws)
> 
> +# if we have added sheets, remove the default one ("Sheet")
> +sheets = book.get_sheet_names()
> +if len(sheets) > 1:
> +    book.remove_sheet(book.get_sheet_by_name("Sheet"))
> +
>  # save the results
>  book.save('results.xlsx')
> -
> --
> 2.7.4
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego

  reply	other threads:[~2017-12-14  1:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  8:42 [Fuego] LTP: fix the spreadsheet parser script Daniel Sangorrin
2017-12-13  8:42 ` [Fuego] [PATCH 1/2] LTP:ltp_process: dont crash if no sheets are generated Daniel Sangorrin
2017-12-14  1:09   ` Bird, Timothy [this message]
2017-12-13  8:42 ` [Fuego] [PATCH 2/2] LTP:ltp_process: parse the rt.log into a new sheet Daniel Sangorrin
2017-12-14  1:07   ` Bird, Timothy
2017-12-14  1:09   ` Bird, Timothy
2017-12-14  1:15 ` [Fuego] LTP: fix the spreadsheet parser script Bird, Timothy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ECADFF3FD767C149AD96A924E7EA6EAF40AE4A2A@USCULXMSG01.am.sony.com \
    --to=tim.bird@sony.com \
    --cc=daniel.sangorrin@toshiba.co.jp \
    --cc=fuego@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.