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