added check_track_sha1 to avoid download issue

This commit is contained in:
raphael60650 2021-06-24 11:26:15 +02:00
parent 23dddaadf3
commit 68c82393d6

View file

@ -1,4 +1,5 @@
import requests import requests
import subprocess
import os import os
from .definition import * from .definition import *
@ -27,3 +28,9 @@ def get_github_file(self, file):
except: except:
self.log_error() self.log_error()
return -1 return -1
def check_track_sha1(file, excepted_sha1):
sha1 = subprocess.run(["./tools/szs/wszst", "SHA1", file]).stdout.decode().split(" ")[0]
if excepted_sha1 == sha1: return 0
else: return -1