Skip to content

Command Line Entry for Check#49

Merged
pydanny merged 1 commit intobinaryornot:masterfrom
moluwole:command-line-entry
Aug 10, 2019
Merged

Command Line Entry for Check#49
pydanny merged 1 commit intobinaryornot:masterfrom
moluwole:command-line-entry

Conversation

@moluwole
Copy link
Copy Markdown

@moluwole moluwole commented Aug 10, 2019

To use the command entry point,

  1. Run python setup.py develop
  2. to use, binaryornot filename

@moluwole moluwole force-pushed the command-line-entry branch from 1b54e58 to 3970695 Compare August 10, 2019 15:57
@pydanny pydanny merged commit 92ba3a9 into binaryornot:master Aug 10, 2019
Copy link
Copy Markdown
Contributor

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Thanks!
See my comments inline.

def main():
parser = argparse.ArgumentParser(description="Check if a "
"file passed as argument is "
"binary or not")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about a simpler: Check if a file is binary or not.

parser.add_argument("filename", help="File name to check for. If "
"the file is not in the same folder, "
"include full path")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about using a simpler "File name or path to check."

"""

import logging
import argparse
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about sorting these imports?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agreed. That's a nice touch for projects.


args = parser.parse_args()

print(is_binary(**vars(args)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will print True or False literally, right? Is this the best way?

Copy link
Copy Markdown
Collaborator

@pydanny pydanny Aug 11, 2019

Choose a reason for hiding this comment

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

@pombredanne, what's a better response?

coverage
tox
hypothesis
argparse No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why would this be needed? This is builtin since 2.7 and 3.2

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