Spaces:
Sleeping
Sleeping
Commit
·
fa3a507
1
Parent(s):
c1db350
new update
Browse files
backend/invoke_worker/chapter_queue.py
CHANGED
@@ -98,16 +98,16 @@ class Job(Thread):
|
|
98 |
|
99 |
job = web_scrap.source_control[source].get_chapter.scrap(comic_id=comic_id,chapter_id=chapter_id,output_dir=input_dir)
|
100 |
if job.get("status") == "success":
|
101 |
-
with open(os.path.join(LOG_DIR,"image_translator_output.log"), "w") as file:
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
if result.returncode != 0: raise Exception("Image Translator Execution error!")
|
112 |
os.makedirs(managed_output_dir,exist_ok=True)
|
113 |
shutil.rmtree(input_dir)
|
|
|
98 |
|
99 |
job = web_scrap.source_control[source].get_chapter.scrap(comic_id=comic_id,chapter_id=chapter_id,output_dir=input_dir)
|
100 |
if job.get("status") == "success":
|
101 |
+
# with open(os.path.join(LOG_DIR,"image_translator_output.log"), "w") as file:
|
102 |
+
result = subprocess.run(
|
103 |
+
script,
|
104 |
+
cwd=os.path.join(BASE_DIR, "backend", "module", "utils", "image_translator"),
|
105 |
+
shell=True,
|
106 |
+
check=True,
|
107 |
+
# stdout=file,
|
108 |
+
# stderr=file,
|
109 |
+
text=True,
|
110 |
+
)
|
111 |
if result.returncode != 0: raise Exception("Image Translator Execution error!")
|
112 |
os.makedirs(managed_output_dir,exist_ok=True)
|
113 |
shutil.rmtree(input_dir)
|