From 5171ebc6b70f96d42b47346b927c3c74ff4a01e6 Mon Sep 17 00:00:00 2001 From: Prakash B R Date: Wed, 19 Jun 2024 12:21:33 +0530 Subject: [PATCH] removed the dependency of setuptool module from xmlcli --- src/xmlcli/UefiFwParser.py | 2 +- src/xmlcli/_version.py | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/xmlcli/UefiFwParser.py b/src/xmlcli/UefiFwParser.py index 526cdbb..7d54680 100644 --- a/src/xmlcli/UefiFwParser.py +++ b/src/xmlcli/UefiFwParser.py @@ -1269,7 +1269,7 @@ def GetsetBiosKnobsFromBin(BiosBinaryFile=0, BiosOutSufix=0, Operation='genxml', if (XmlFilename == 0): XmlFilename = os.path.join(clb.TempFolder, '%s_FwInfo.xml' %BiosIdString) file_content = '\n' - '\t\n' %(clb.__version__.version[0], clb.__version__.version[1], clb.__version__.version[2]) + '\t\n' % clb.__version__ BiosIdLst = BiosIdString.split('.') BiosDate = BiosIdLst[len(BiosIdLst)-1] if(FoundPcBuild): diff --git a/src/xmlcli/_version.py b/src/xmlcli/_version.py index 3bf475c..9ae89c2 100644 --- a/src/xmlcli/_version.py +++ b/src/xmlcli/_version.py @@ -1,4 +1,12 @@ -from distutils.version import LooseVersion +class Version: + def __init__(self, major, minor, build, tag=""): + self.major=major + self.minor=minor + self.build=build + self.tag=tag + + def __str__(self): + return f"{self.major}.{self.minor}.{self.build}{self.tag}" # MAJOR ---------- # incremented any time you change the API that may break backwards compatibility @@ -7,12 +15,10 @@ # MINOR ------------ MINOR = 0 # BUILD ------ -BUILD = 4 # or __revision__ +BUILD = 5 # or __revision__ # TAG ------- TAG = "" -__version__ = LooseVersion("{major}.{minor}.{build}{tag}".format( - major=MAJOR, - minor=MINOR, - build=BUILD, - tag=TAG -)) + +version_instance = Version(MAJOR, MINOR, BUILD, TAG) + +__version__ = str(version_instance)