task3 #2
@ -1,3 +1,31 @@
|
||||
class VersionManager:
|
||||
def __init__(self, version):
|
||||
def __init__(self, version="0.0.1"):
|
||||
version = version.split(".")[:3]
|
||||
try:
|
||||
for val in version:
|
||||
assert val.isdecimal(), "Error occured while parsing version!"
|
||||
except AssertionError as error:
|
||||
print(error)
|
||||
|
||||
self.version = ".".join(version)
|
||||
self.history = [self.version]
|
||||
|
||||
def major(self) -> None:
|
||||
pass
|
||||
|
||||
def minor(self) -> None:
|
||||
pass
|
||||
|
||||
def path(self) -> None:
|
||||
pass
|
||||
|
||||
def rollback(self) -> None:
|
||||
pass
|
||||
|
||||
def release(self) -> str:
|
||||
return f"{self.version}"
|
||||
|
||||
|
||||
test = VersionManager("1.1")
|
||||
print(test.version)
|
||||
print(test.history)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user