We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 614bbde commit b65f009Copy full SHA for b65f009
go_capture/tasks.py
@@ -1,7 +1,10 @@
1
import os
2
+from pathlib import Path
3
4
from celery import Celery
5
6
+from go_capture.sgf.process_image import process_image
7
+
8
# Set the default Django settings module for the 'celery' program.
9
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'go_capture.settings')
10
@@ -24,4 +27,7 @@ def debug_task(self):
24
27
25
28
@app.task
26
29
def process_image_task(image_filename):
- print(image_filename)
30
+ sgf_filename = f'{Path(image_filename).stem}.sgf'
31
+ with open(image_filename, 'rb') as image_file:
32
+ with open(sgf_filename, 'w') as sgf_file:
33
+ process_image(image_file, sgf_file)
0 commit comments