emcli: Allow roi 404
This commit is contained in:
parent
0f8cf2ff5c
commit
591159323c
@ -89,8 +89,10 @@ class GetScanDataCommand(SubCommand):
|
||||
f.write(sd['message'] + "\n")
|
||||
with open(f"{args.output}/{i}-frame.jpg", "wb") as f:
|
||||
f.write(self.get_image(sd['image']))
|
||||
with open(f"{args.output}/{i}-roi.jpg", "wb") as f:
|
||||
f.write(self.get_roi(sd['code']))
|
||||
roi = self.get_roi(sd['code'])
|
||||
if roi:
|
||||
with open(f"{args.output}/{i}-roi.jpg", "wb") as f:
|
||||
f.write(roi)
|
||||
|
||||
def get_scan_data(self, i):
|
||||
server = self.get_server()
|
||||
@ -112,7 +114,8 @@ class GetScanDataCommand(SubCommand):
|
||||
token = self.get_env()['token']
|
||||
url = f'{server}/api/v1/code-feature-roi/?token={token}&code={code}'
|
||||
r = requests.get(url)
|
||||
r.raise_for_status()
|
||||
if r.status_code == 404:
|
||||
return None
|
||||
return r.content
|
||||
|
||||
class UploadRoiCommand(SubCommand):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user