-
Notifications
You must be signed in to change notification settings - Fork 14
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
subcommands #6
subcommands #6
Conversation
ide50/__main__.py
Outdated
"""Print container port mappings and URL""" | ||
# List port mappings | ||
print(ports(container)) | ||
print(_("Running on {}. Run `ide50 -S` to stop.").format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ide50 stop
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Fixed. Thanks!
repository, tag = image.split(":") if ":" in image else (image, "latest") | ||
if "/" not in repository: | ||
repository = "library/" + repository | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary blank line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I typically use a blank line after if
s, for
s, groups of related statements, multi-line statements, etc to visually separate them https://www.python.org/dev/peps/pep-0008/#blank-lines.
pass | ||
except AssertionError: | ||
print(_("A newer version is available. Run `pip3 install --upgrade ide50` to upgrade.")) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment?
except subprocess.CalledProcessError: | ||
|
||
# Publish all exposed ports to random ports | ||
try: | ||
container = subprocess.check_output([*cmd, "--publish-all", args.image]).decode().rstrip() | ||
container = subprocess.check_output([*cmd, "--publish-all", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clever
print(ports(container)) | ||
print(_("Running on {}. Run `ide50 -S` to stop.").format(f"http://{ports(container.split()[0], C9_PORT)}/")) | ||
|
||
container_info(container) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment?
def pull(image): | ||
"""Pull image as needed.""" | ||
try: | ||
sys.exit(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary blank line?
E.g.,