|
28 | 28 | """ |
29 | 29 |
|
30 | 30 | import io |
| 31 | +import json |
31 | 32 | import logging |
32 | 33 | import os |
33 | 34 | import subprocess |
34 | 35 | import time |
35 | | -import json |
36 | 36 |
|
37 | 37 | from ansys.dpf.gate.load_api import ( |
38 | 38 | _find_outdated_ansys_version, |
@@ -92,18 +92,22 @@ def __init__( |
92 | 92 | from ansys.dpf.core import LOCAL_DOWNLOADED_EXAMPLES_PATH |
93 | 93 |
|
94 | 94 | if use_docker: |
95 | | - args = ['docker', 'inspect', '-f', 'json', docker_name] |
| 95 | + args = ["docker", "inspect", "-f", "json", docker_name] |
96 | 96 | inspect_docker_image = subprocess.run(args, capture_output=True) |
97 | 97 | if inspect_docker_image.stderr: |
98 | | - raise Exception(f"Specified docker image not found. Verify that the image name '{docker_name}' is valid and the image file is available locally.") |
| 98 | + raise Exception( |
| 99 | + f"Specified docker image not found. Verify that the image name '{docker_name}' is valid and the image file is available locally." |
| 100 | + ) |
99 | 101 |
|
100 | 102 | output = json.loads(inspect_docker_image.stdout) |
101 | | - image_os = output[0]['Os'] |
| 103 | + image_os = output[0]["Os"] |
102 | 104 | if mounted_volumes is None: |
103 | | - if image_os == 'linux': |
| 105 | + if image_os == "linux": |
104 | 106 | mounted_volumes = {LOCAL_DOWNLOADED_EXAMPLES_PATH: "/tmp/downloaded_examples"} |
105 | | - else: # image is windows |
106 | | - mounted_volumes = {LOCAL_DOWNLOADED_EXAMPLES_PATH: "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp\\downloaded_examples"} |
| 107 | + else: # image is windows |
| 108 | + mounted_volumes = { |
| 109 | + LOCAL_DOWNLOADED_EXAMPLES_PATH: "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp\\downloaded_examples" |
| 110 | + } |
107 | 111 |
|
108 | 112 | self._use_docker = use_docker |
109 | 113 | self._docker_name = docker_name |
|
0 commit comments