Skip to content

Commit cb077fb

Browse files
committed
refactoring
1 parent d34f0e2 commit cb077fb

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

piper/base/executors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ def run_container(image: str, ports: Dict[int, int]):
131131

132132

133133
def wait_for_fast_api_app_start(host, external_port, wait_on_iter, n_iters):
134-
'''
134+
"""
135135
wait for fast api app will be loaded
136-
external_port -
136+
external_port -
137137
wait_on_iter - seconds between health_check requests
138138
n_iters - total health_check requests
139-
'''
139+
"""
140140
logger.info('waiting for FastAPI app start')
141141
i = 0
142142
while True:

piper/utils/docker_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
cfg = get_configuration()
99

10+
1011
def get_image(docker_client, image_name):
1112
try:
1213
cur_image = docker_client.images.get(image_name)
@@ -36,6 +37,7 @@ def get_container(docker_client, container_name):
3637
logger.error(f'non defined exeption {e}')
3738
return False
3839

40+
3941
def get_container_with_status(docker_client, container_name):
4042
try:
4143
cur_container = docker_client.containers.get(container_name)
@@ -50,6 +52,7 @@ def get_container_with_status(docker_client, container_name):
5052
logger.error(f'non defined exeption {e}')
5153
return False
5254

55+
5356
def stop_container(docker_client, container_name):
5457
try:
5558
cur_container = docker_client.containers.get(container_name)
@@ -172,7 +175,6 @@ def create_image_and_container_by_dockerfile(docker_client, path, image_tag, con
172175
sys.exit()
173176
time.sleep(cfg.docker_wait_on_iter)
174177

175-
176178
except docker.errors.APIError as api_e:
177179
logger.error(f'eroror while run container {container_name}')
178180
logger.error(str(api_e))

piper/utils/tesrct_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
cfg = get_configuration()
1111

12+
1213
def send_file_to_service(url, file_path, json_key):
1314
multipart_form_data = {
1415
'file': open(file_path, 'rb')
@@ -28,6 +29,7 @@ def send_file_to_service(url, file_path, json_key):
2829
logger.error(f'exeption while connect to {url}')
2930
logger.error(ce)
3031

32+
3133
def img_to_text(img, ts_conf):
3234
logger.info(f'pytesseract process file with len {len(img)}')
3335
txt_dict = pytesseract.image_to_data(

0 commit comments

Comments
 (0)