From 17ca47ae1c3387e83704e3305dfeef4d326933c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=A8?= Date: Wed, 21 Jun 2023 15:42:30 +0800 Subject: [PATCH] update --- utils/updateObs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/updateObs.py b/utils/updateObs.py index aee7a6a..8f5c462 100644 --- a/utils/updateObs.py +++ b/utils/updateObs.py @@ -55,7 +55,7 @@ def addobs(file_path, status): #save videos time = os.path.basename(file_path).split('-')[0] if objectkey.split('.')[-1] in ['avi','mp4']: objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey - resp = obsClient.putFile(bucketName, objectkey, file_path, hearders=headers) + resp = obsClient.putFile(bucketName, objectkey, file_path, headers=headers) #os.remove(file_path) def updateAgain(): @@ -73,7 +73,7 @@ def updateAgain(): time = os.path.basename(file_path).split('-')[0] if objectkey.split('.')[-1] in ['avi','mp4']: objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey - resp = obsClient.putFile(bucketName, objectkey, file_path, hearders=headers) + resp = obsClient.putFile(bucketName, objectkey, file_path, headers=headers) os.remove(file_path) except Exception as e: pass @@ -86,14 +86,14 @@ def Addimg(uuid_barcode): file_path = os.sep.join([cfg.Tempimg, '3_'+uuid_barcode+'.jpg']) if not os.path.exists(file_path): file_path = os.sep.join([cfg.Tempimg, 'ex_'+uuid_barcode+'.jpg']) - resp = obsClient.putFile(bucketName, objectkey, file_path, hearders=headers) + resp = obsClient.putFile(bucketName, objectkey, file_path, headers=headers) def Addimg_content(uuid_barcode, context): success, encoded_image = cv2.imencode(".jpg",context) context = encoded_image.tobytes() time = uuid_barcode.split('-')[0] objectkey = 'imgs/'+time+'/'+uuid_barcode+'.jpg' - resp = obsClient.putContent(bucketName, objectkey, context, hearders=headers) + resp = obsClient.putContent(bucketName, objectkey, context, headers=headers) if __name__ == '__main__': import cv2