- MetaData'yi calisabilir hale getir.
Halen is gormekten uzak. Metadata isini bana birakabilirsiniz.
This commit is contained in:
+8
-5
@@ -7,13 +7,16 @@ from specfile import SpecFile
|
|||||||
|
|
||||||
class MetaData(SpecFile):
|
class MetaData(SpecFile):
|
||||||
"""This is a superset of the source spec definition"""
|
"""This is a superset of the source spec definition"""
|
||||||
|
def __init__(self):
|
||||||
|
XmlFile.__init__(self, "METADATA")
|
||||||
|
|
||||||
def read(self, filename):
|
def read(self, filename):
|
||||||
super(MetaData, self).read(filename)
|
self.readxml(filename)
|
||||||
distribution = self.getNodeText("Source/Distribution")
|
|
||||||
distributionRelease = self.getNodeText("Source/DistributionRelease")
|
self.distribution = self.getNodeText("Source/Distribution")
|
||||||
architecture = self.getNodeText("Source/Architecture")
|
self.distributionRelease = self.getNodeText("Source/DistributionRelease")
|
||||||
installedSize = int(self.getNodeText("Source/InstalledSize"))
|
self.architecture = self.getNodeText("Source/Architecture")
|
||||||
|
self.installedSize = self.getNodeText("Source/InstalledSize")
|
||||||
|
|
||||||
def write(self, filename):
|
def write(self, filename):
|
||||||
ui.info("METADATA WRITE NOT IMPLEMENTED\n")
|
ui.info("METADATA WRITE NOT IMPLEMENTED\n")
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ class MetaDataTestCase(unittest.TestCase):
|
|||||||
def testReadWrite(self):
|
def testReadWrite(self):
|
||||||
md = metadata.MetaData()
|
md = metadata.MetaData()
|
||||||
md.read('tests/sandbox/metadata.xml')
|
md.read('tests/sandbox/metadata.xml')
|
||||||
|
print md.installedSize
|
||||||
|
|
||||||
suite = unittest.makeSuite(MetaDataTestCase)
|
suite = unittest.makeSuite(MetaDataTestCase)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
|
||||||
<PSPEC>
|
<METADATA>
|
||||||
|
|
||||||
<Source>
|
<Source>
|
||||||
<Name>sandbox</Name>
|
<Name>sandbox</Name>
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
<InstalledSize>40500</InstalledSize>
|
<InstalledSize>40500</InstalledSize>
|
||||||
</Package>
|
</Package>
|
||||||
|
|
||||||
</PSPEC>
|
</METADATA>
|
||||||
|
|||||||
Reference in New Issue
Block a user