This commit is contained in:
itswait
2020-08-21 10:31:27 +08:00
parent 3a019a0430
commit 51ad58445e
5 changed files with 37 additions and 61 deletions

View File

@@ -3,15 +3,14 @@ from core import *
import os
from number_parser import get_number
__version__ = '3.7.1'
def check_update(local_version):
data = json.loads(get_html("https://api.github.com/repos/yoshiko2/AV_Data_Capture/releases/latest"))
def check_update():
latest = get_html("https://api.github.com/repos/yoshiko2/AV_Data_Capture/releases/latest",
return_type="json")["tag_name"]
remote = data["tag_name"]
local = local_version
if not local == remote:
line1 = "* New update " + str(remote) + " *"
if __version__ != latest:
line1 = "* New update " + str(latest) + " *"
print("[*]" + line1.center(54))
print("[*]" + "↓ Download ↓".center(54))
print("[*] https://github.com/yoshiko2/AV_Data_Capture/releases")
@@ -111,7 +110,6 @@ def create_data_and_move_with_custom_number(file_path: str, c: config.Config, cu
if __name__ == '__main__':
version = '3.7.1'
# Parse command line args
single_file_path, config_file, auto_exit, custom_number = argparse_function()
@@ -119,13 +117,13 @@ if __name__ == '__main__':
# Read config.ini
conf = config.Config(path=config_file)
version_print = 'Version ' + version
version_print = 'Version ' + __version__
print('[*]================== AV Data Capture ===================')
print('[*]' + version_print.center(54))
print('[*]======================================================')
if conf.update_check():
check_update(version)
check_update()
create_failed_folder(conf.failed_folder())
os.chdir(os.getcwd())