Setup python builder
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user