Skip to content

Commit

Permalink
Moved conditional imports closer to actual usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan committed Oct 8, 2024
1 parent e129fc7 commit 690e439
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cli50/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

import argparse
import gettext
import inflect
import json
import os
import re
import requests
import shlex
import shutil
import subprocess
import textwrap
import tzlocal

from importlib.resources import files
from packaging import version

Expand Down Expand Up @@ -123,6 +120,7 @@ def main():
sys.exit("No containers are running.")

# Ask whether to use a running container
import inflect, textwrap
for ID, Image, RunningFor, Status, Mounts in containers:
while True:
prompt = _("Log into {}, created {}, {}").format(Image, RunningFor, Status)
Expand Down Expand Up @@ -172,6 +170,7 @@ def main():
if not args["fast"]:

# Remote manifest
import json
try:
RemoteManifest = json.loads(subprocess.check_output([
"docker", "manifest", "inspect", f"{IMAGE}:{args['tag']}", "--verbose"
Expand Down Expand Up @@ -324,6 +323,7 @@ def ports(container):

def pull(image, tag):
"""Pull image as needed."""
import json
try:

# Get the latest manifest from registry
Expand Down

0 comments on commit 690e439

Please sign in to comment.