From 55652090182f25b3fb6cb13389f4b833f2f624a3 Mon Sep 17 00:00:00 2001 From: "apps.0install.net" Date: Thu, 23 Sep 2021 17:14:59 +0200 Subject: [PATCH] Updated Blender --- gui/blender-linux.watch.py | 33 ++++------------------------- gui/blender-linux.xml | 23 ++++++++++++++++++++ gui/blender-linux.xml.template | 4 ++-- gui/blender-macos.watch.py | 33 ++++------------------------- gui/blender-macos.xml | 36 ++++++++++++++++++++++++++++++++ gui/blender-macos.xml.template | 4 ++-- gui/blender-windows.watch.py | 33 ++++------------------------- gui/blender-windows.xml | 4 ++++ gui/blender-windows.xml.template | 4 ++-- gui/blender.py | 15 +++++++++++++ 10 files changed, 96 insertions(+), 93 deletions(-) create mode 100644 gui/blender.py diff --git a/gui/blender-linux.watch.py b/gui/blender-linux.watch.py index ac336551c..d6854545c 100644 --- a/gui/blender-linux.watch.py +++ b/gui/blender-linux.watch.py @@ -1,31 +1,6 @@ #os=Linux -from urllib import request -import re -from datetime import datetime +import sys, os +sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) +import blender -def regex(url, pattern): - return re.findall(pattern, request.urlopen(url).read().decode('utf-8')) - -def to_zi_version(input): - suffix = '' - if input.endswith('-alpha'): - input = input.replace('-alpha', '') - suffix = '-pre-pre' - if input.endswith('-beta'): - input = input.replace('-beta', '') - suffix = '-pre' - if not input[-1].isdigit(): - input = input[:-1] + '-' + str(ord(input[-1]) - 96) - return input + suffix - -releases = [] - -for version_main in regex('https://download.blender.org/release/', r'>Blender([\d\.a-z]+)\/<\/a>'): - for match in regex('https://download.blender.org/release/Blender' + version_main + '/', r'>blender-([\d\.\-a-z]+)-linux-x64\.tar\.xz<\/a>\s+(..-...-....)'): - releases.append({ - 'version': to_zi_version(match[0].replace('-release', '').replace('rc', '-rc')), - 'version-main': version_main, - 'version-full': match[0], - 'stability': 'testing' if 'alpha' in match[0] or 'beta' in match[0] or 'rc' in match[0] else 'stable', - 'released': datetime.strftime(datetime.strptime(match[1], '%d-%b-%Y'), '%Y-%m-%d') - }) +releases = blender.releases('linux-x64.tar.xz') diff --git a/gui/blender-linux.xml b/gui/blender-linux.xml index 1ff2fb9ee..cf84aa8a2 100644 --- a/gui/blender-linux.xml +++ b/gui/blender-linux.xml @@ -400,4 +400,27 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gui/blender-linux.xml.template b/gui/blender-linux.xml.template index 5e92fc980..1831f7c93 100644 --- a/gui/blender-linux.xml.template +++ b/gui/blender-linux.xml.template @@ -13,9 +13,9 @@ - + - + diff --git a/gui/blender-macos.watch.py b/gui/blender-macos.watch.py index d38e752c1..56e89097f 100644 --- a/gui/blender-macos.watch.py +++ b/gui/blender-macos.watch.py @@ -1,31 +1,6 @@ #os=Darwin -from urllib import request -import re -from datetime import datetime +import sys, os +sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) +import blender -def regex(url, pattern): - return re.findall(pattern, request.urlopen(url).read().decode('utf-8')) - -def to_zi_version(input): - suffix = '' - if input.endswith('-alpha'): - input = input.replace('-alpha', '') - suffix = '-pre-pre' - if input.endswith('-beta'): - input = input.replace('-beta', '') - suffix = '-pre' - if not input[-1].isdigit(): - input = input[:-1] + '-' + str(ord(input[-1]) - 96) - return input + suffix - -releases = [] - -for version_main in regex('https://download.blender.org/release/', r'>Blender([\d\.a-z]+)\/<\/a>'): - for match in regex('https://download.blender.org/release/Blender' + version_main + '/', r'>blender-([\d\.\-a-z]+)-macos-x64\.dmg<\/a>\s+(..-...-....)'): - releases.append({ - 'version': to_zi_version(match[0].replace('-release', '').replace('rc', '-rc')), - 'version-main': version_main, - 'version-full': match[0], - 'stability': 'testing' if 'alpha' in match[0] or 'beta' in match[0] or 'rc' in match[0] else 'stable', - 'released': datetime.strftime(datetime.strptime(match[1], '%d-%b-%Y'), '%Y-%m-%d') - }) +releases = blender.releases('macos-x64.dmg') diff --git a/gui/blender-macos.xml b/gui/blender-macos.xml index 2aab55117..8e6e2951c 100644 --- a/gui/blender-macos.xml +++ b/gui/blender-macos.xml @@ -252,5 +252,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gui/blender-macos.xml.template b/gui/blender-macos.xml.template index b84bff1ba..c85e63f61 100644 --- a/gui/blender-macos.xml.template +++ b/gui/blender-macos.xml.template @@ -13,9 +13,9 @@ - + - + diff --git a/gui/blender-windows.watch.py b/gui/blender-windows.watch.py index d22658243..306431ad4 100644 --- a/gui/blender-windows.watch.py +++ b/gui/blender-windows.watch.py @@ -1,31 +1,6 @@ #os=Windows -from urllib import request -import re -from datetime import datetime +import sys, os +sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) +import blender -def regex(url, pattern): - return re.findall(pattern, request.urlopen(url).read().decode('utf-8')) - -def to_zi_version(input): - suffix = '' - if input.endswith('-alpha'): - input = input.replace('-alpha', '') - suffix = '-pre-pre' - if input.endswith('-beta'): - input = input.replace('-beta', '') - suffix = '-pre' - if not input[-1].isdigit(): - input = input[:-1] + '-' + str(ord(input[-1]) - 96) - return input + suffix - -releases = [] - -for version_main in regex('https://download.blender.org/release/', r'>Blender([\d\.a-z]+)\/<\/a>'): - for match in regex('https://download.blender.org/release/Blender' + version_main + '/', r'>blender-([\d\.\-a-z]+)-windows-x64\.zip<\/a>\s+(..-...-....)'): - releases.append({ - 'version': to_zi_version(match[0].replace('-release', '').replace('rc', '-rc')), - 'version-main': version_main, - 'version-full': match[0], - 'stability': 'testing' if 'alpha' in match[0] or 'beta' in match[0] or 'rc' in match[0] else 'stable', - 'released': datetime.strftime(datetime.strptime(match[1], '%d-%b-%Y'), '%Y-%m-%d') - }) +releases = blender.releases('windows-x64.zip') diff --git a/gui/blender-windows.xml b/gui/blender-windows.xml index 8893fb162..f9cd6ecab 100644 --- a/gui/blender-windows.xml +++ b/gui/blender-windows.xml @@ -568,5 +568,9 @@ + + + + diff --git a/gui/blender-windows.xml.template b/gui/blender-windows.xml.template index bcff9cf21..eca3d3b83 100644 --- a/gui/blender-windows.xml.template +++ b/gui/blender-windows.xml.template @@ -13,9 +13,9 @@ - + - + diff --git a/gui/blender.py b/gui/blender.py new file mode 100644 index 000000000..5aa6b8986 --- /dev/null +++ b/gui/blender.py @@ -0,0 +1,15 @@ +from urllib import request +import re +from datetime import datetime + +def regex(url, pattern): + return re.findall(pattern, request.urlopen(url).read().decode('utf-8')) + +def releases(suffix): + for minor_version in regex('https://download.blender.org/release/', r'>Blender([\d\.a-z]+)\/<\/a>'): + for match in regex('https://download.blender.org/release/Blender' + minor_version + '/', r'>blender-([\d\.\-a-z]+)-' + re.escape(suffix) + '<\/a>\s+(..-...-....)'): + yield { + 'version': match[0], + 'minor-version': minor_version, + 'released': datetime.strftime(datetime.strptime(match[1], '%d-%b-%Y'), '%Y-%m-%d') + }