Open sjanssen2 opened 7 years ago
@sjanssen2 I found this is how argparse
does the job. In the very beginning I implemented a homebrew solution that will warn the user if they want to overwrite an existing file. Later I thought: 1) from the user's angle, they may prefer to perform no additional actions (e.g., rename or move the old output file, or specify a new file name). 2) On the other hand, the output file is not going to be placed in archive. The user will immediately copy and paste the entire output file into an Excel spreadsheet, which is in turn the final "mapping file".
@qiyunzhu Just FYI, click is a really good library for parsing parameters.
@josenavas Thanks! We used click in the WGS-HGT project. It is indeed more robust than argparse.
argparse is also broken as it is not posix compliant. click actually ships with a py3 compatible implementation of python2's optparse.
On Wed, Nov 2, 2016 at 12:53 PM, Qiyun Zhu notifications@github.com wrote:
@josenavas https://github.com/josenavas Thanks! We used click in the WGS-HGT https://github.com/biocore/WGS-HGT project. It is indeed more robust than argparse.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8#issuecomment-257979558, or mute the thread https://github.com/notifications/unsubscribe-auth/AAc8styNcdbvL926aKnAap0Fuj-98jv8ks5q6OorgaJpZM4KmZ6F .
Hmm. I didn't know that ...
On Nov 7, 2016 9:40 PM, "Daniel McDonald" notifications@github.com wrote:
argparse is also broken as it is not posix compliant. click actually ships with a py3 compatible implementation of python2's optparse.
On Wed, Nov 2, 2016 at 12:53 PM, Qiyun Zhu notifications@github.com wrote:
@josenavas https://github.com/josenavas Thanks! We used click in the WGS-HGT https://github.com/biocore/WGS-HGT project. It is indeed more robust than argparse.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8# issuecomment-257979558, or mute the thread https://github.com/notifications/unsubscribe-auth/ AAc8styNcdbvL926aKnAap0Fuj-98jv8ks5q6OorgaJpZM4KmZ6F .
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8#issuecomment-259050691, or mute the thread https://github.com/notifications/unsubscribe-auth/AD_a3bXIq6QqHWj-K5BzfOPq-4F2zoy1ks5q8AtOgaJpZM4KmZ6F .
I lied, sorry, but reasons are outlined here:
http://click.pocoo.org/5/why/#why-not-argparse
On Mon, Nov 7, 2016 at 9:51 PM, Jamie Morton notifications@github.com wrote:
Hmm. I didn't know that ...
On Nov 7, 2016 9:40 PM, "Daniel McDonald" notifications@github.com wrote:
argparse is also broken as it is not posix compliant. click actually ships with a py3 compatible implementation of python2's optparse.
On Wed, Nov 2, 2016 at 12:53 PM, Qiyun Zhu notifications@github.com wrote:
@josenavas https://github.com/josenavas Thanks! We used click in the WGS-HGT https://github.com/biocore/WGS-HGT project. It is indeed more robust than argparse.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8# issuecomment-257979558, or mute the thread https://github.com/notifications/unsubscribe-auth/ AAc8styNcdbvL926aKnAap0Fuj-98jv8ks5q6OorgaJpZM4KmZ6F .
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8# issuecomment-259050691, or mute the thread https://github.com/notifications/unsubscribe- auth/AD_a3bXIq6QqHWj-K5BzfOPq-4F2zoy1ks5q8AtOgaJpZM4KmZ6F .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8#issuecomment-259052004, or mute the thread https://github.com/notifications/unsubscribe-auth/AAc8sj3M8IDCBvsF9vVmjVBKmvOoOND9ks5q8A34gaJpZM4KmZ6F .
Yup. Click is definitely more preferable than argparse. But @qiyunzhu was under pressure to get something out quickly, and something easy to use. I mean really easy - no installation required. This works out of the box without installing any packages.
Like @josenavas mentioned before, we'll deprecate this and move into labadmin.
@wasade Good to know! Thanks!
The system does not warn when overwriting an existing file. I think we should have a 'force' option that is unset by default for the case that we really want to overwrite something.