Setup python builder

This commit is contained in:
2026-07-18 16:45:19 +02:00
parent 82653b4fba
commit 693afc76fd
11 changed files with 108 additions and 48 deletions
+26
View File
@@ -0,0 +1,26 @@
class BlenderVersion:
def __init__(self, version: str = '5.1.0'):
"""
Need an object like 'X.Y.Z' to work correctly, build a pythonic object about a blender version.
:param version:
"""
self.major : str = ''
self.minor : str = ''
self.hotfix : str = ''
self.version_object(version)
def version_object(self, version: str):
"""Set all version properties to a string"""
version = version.split('.')
self.major = version[0]
self.minor = version[1]
self.hotfix = version[2]
def format_to_tag(self) -> str:
"""From version information, format to return a string"""
return f'{self.major}.{self.minor}.{self.hotfix}'
def __str__(self):
return str(self.major + '.' + self.minor + '.' + self.hotfix)