Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update_signatures.py: add CLI options, new debug option #102

Merged
merged 3 commits into from
Jun 27, 2017

Conversation

mistydemeo
Copy link
Contributor

For debugging, I find it really useful to be able to control several of the defaults used by update_signatures. I also find it really useful to be able to disable deleting the temporary directory. I was debugging a bug that happens between downloading files and running the steps in the prepare module, which also happens to be where the temp files get deleted - a lesson I learned the hard way!

@mistydemeo mistydemeo requested review from sevein and Hwesta March 11, 2017 06:59
@mistydemeo mistydemeo force-pushed the update_signatures_options branch from a81f2ce to de0e404 Compare March 11, 2017 07:02
@mistydemeo mistydemeo force-pushed the update_signatures_options branch 8 times, most recently from dd1271a to 3e3cc2d Compare March 12, 2017 03:06
@mistydemeo
Copy link
Contributor Author

It turned out we were importing and calling the main function from the prepare module, and it was still doing argument parsing, which broke up if the calling script also does argument parsing. I've moved the main logic into a separate run function which can be called independently without depending on the state of ARGV.

Copy link
Contributor

@Hwesta Hwesta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Being able to troubleshoot update signatures without having to re-download every file seems very convenient.

parser.add_argument('-http_throttle', default=options['http_throttle'], help='Time (in seconds) to wait between downloads', type=float, dest='http_throttle')
args = parser.parse_args()
opts = defaults.copy()
opts.update(args.__dict__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think vars(args) is more appropriate here. It accesses the namespace's dict, but without using a __ function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

@mistydemeo mistydemeo force-pushed the update_signatures_options branch from 3e3cc2d to 05f4508 Compare March 17, 2017 02:29
@jhsimpson jhsimpson modified the milestone: 1.3.6 Jun 16, 2017
Copy link
Contributor

@sevein sevein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working. Nice additions, thank you!

@sevein sevein added this to the 1.3.6 milestone Jun 26, 2017
@sevein sevein mentioned this pull request Jun 26, 2017
@jhsimpson jhsimpson merged commit 4abca55 into openpreserve:master Jun 27, 2017
@mistydemeo mistydemeo deleted the update_signatures_options branch June 28, 2017 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants