Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #12979 (accepted)

Opened 4 years ago

Last modified 4 years ago

RFE: improve error message for CLI export onto existing file

Reported by: mtbcarroll Owned by: cblackburn
Priority: minor Milestone: Unscheduled
Component: OmeroPy Version: OMERO-5.1.3
Keywords: n.a. Cc: python-team@…
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

bin/omero export --file /tmp/foo.ome.tif Image:1

produces some nasty error about invalid NewFileType('wb') if /tmp/foo.ome.tif already exists. Perhaps we could improve the message.

Change History (6)

comment:1 Changed 4 years ago by cblackburn

It looks like this is arising in omero_ext/argparse.py where any message in the ValueError is ignored in favour of a generic message created at this point. We could patch our local copy of argparse.py to handle this but do we want to do that now that this package is bundled with the Python standard library?

comment:2 Changed 4 years ago by jamoore

I'd say we shouldn't be patching argparse.

comment:3 Changed 4 years ago by cblackburn

I'd agree, especially as it is slated from removal from omero_ext. We may be able to tidy up the output bu I am not sure how easy it would be to provide the actual message. For the longer term, maybe raise and issue against argpase?

comment:4 Changed 4 years ago by cblackburn

Ah, I think I have it:

ls30778:openmicroscopy colin$ omero export --file foo.ome.tif Image:1
usage: /Users/colin/Work/repos/openmicroscopy/dist/bin/omero export
       [-h] -f FILE [-t {TIFF,XML}] [--iterate] [-C] [-s SERVER] [-p PORT]
       [-g GROUP] [-u USER] [-w PASSWORD] [-k KEY] [--sudo ADMINUSER] [-q]
       obj
/Users/colin/Work/repos/openmicroscopy/dist/bin/omero export: error: argument -f/--file: File exists: foo.ome.tif

comment:5 Changed 4 years ago by cblackburn

  • Status changed from new to accepted
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.101241 sec.)

We're Hiring!