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

Transform debugging scripts so that they can be used as libs easily #127

Merged
merged 1 commit into from
Sep 20, 2018
Merged

Transform debugging scripts so that they can be used as libs easily #127

merged 1 commit into from
Sep 20, 2018

Conversation

m09
Copy link
Contributor

@m09 m09 commented Sep 20, 2018

No description provided.

@m09 m09 requested review from EgorBu and vmarkovtsev September 20, 2018 07:39
except AttributeError:
def print_usage(_):
parser.print_usage()

handler = print_usage
return handler(args)
return handler(**vars(args))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see where vars comes from...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's to transform the argsparse.Namespace into a dict

Copy link
Collaborator

Choose a reason for hiding this comment

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

BTW @zurk this is a nice solution of our API problems in sourced-ml - just feed the args as kwargs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@m09 Yes but we do not import vars nor define that function, do we?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Holy crap it's a built-in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it's similar to dir

Copy link
Contributor

Choose a reason for hiding this comment

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

cool!

@vmarkovtsev vmarkovtsev merged commit 0752736 into src-d:master Sep 20, 2018
@m09 m09 deleted the feature/debug-as-lib branch September 20, 2018 12:25
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.

3 participants