File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 126
126
127
127
IMAGES_DIR = BASE_DIR / 'images'
128
128
IMAGES_DIR .mkdir (exist_ok = True )
129
+
130
+ SGF_DIR = BASE_DIR / 'sgf'
131
+ SGF_DIR .mkdir (exist_ok = True )
Original file line number Diff line number Diff line change 2
2
from pathlib import Path
3
3
4
4
from celery import Celery
5
+ from django .conf import settings
5
6
6
7
from go_capture .sgf .process_image import process_image
7
8
@@ -28,6 +29,7 @@ def debug_task(self):
28
29
@app .task
29
30
def process_image_task (image_filename ):
30
31
sgf_filename = f'{ Path (image_filename ).stem } .sgf'
32
+ sgf_path = settings .SGF_DIR / sgf_filename
31
33
with open (image_filename , 'rb' ) as image_file :
32
- with open (sgf_filename , 'w' ) as sgf_file :
34
+ with open (sgf_path , 'w' ) as sgf_file :
33
35
process_image (image_file , sgf_file )
You can’t perform that action at this time.
0 commit comments