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

Create a proper package #39

Merged
merged 6 commits into from
Aug 6, 2021
Merged

Create a proper package #39

merged 6 commits into from
Aug 6, 2021

Conversation

smurfix
Copy link
Contributor

@smurfix smurfix commented Jul 20, 2021

Four top-level modules, two of them with generic names, is bad.

Closes #38.

setup.py Outdated Show resolved Hide resolved
While "_main" may be widely used for this, it's also somewhat unintuitive.
@@ -30,3 30,6 @@ def main(assigned_args: list = None):

for addr in args.dest_addr:
ping3.verbose_ping(addr, count=args.count, ttl=args.ttl, timeout=args.timeout, size=args.size, interval=args.interval, interface=args.interface)

if __name__ == "__main__":
Copy link
Owner

@kyan001 kyan001 Jul 22, 2021

Choose a reason for hiding this comment

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

We suppose to use python3 -m ping3.command_line ... to run this line, right?

Should we need a __main__.py which has the following content?

from . import command_line

if __name__ == "__main__":
    command_line.main()

So that we can use python3 -m ping3 ... to run in command line.

@kyan001 kyan001 merged commit 9f4b75e into kyan001:master Aug 6, 2021
@smurfix
Copy link
Contributor Author

smurfix commented Aug 6, 2021

Thank you.

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.

Packaging
2 participants