From af69496e3eb7e61a4cacc69358a3852c2ed4667a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Wed, 29 Jun 2005 11:01:09 +0000 Subject: [PATCH] =?UTF-8?q?-=20specfile:verify()=20lar=C4=B1n=20=C3=A7al?= =?UTF-8?q?=C4=B1=C5=9Fmas=C4=B1n=C4=B1=20sa=C4=9Fla=20-=20sandbox.pspec?= =?UTF-8?q?=20de=20yeni=20"type"=20attribute'unu=20kullans=C4=B1n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/specfile.py | 16 +++++++--------- tests/sandbox/sandbox.pspec | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pisi/specfile.py b/pisi/specfile.py index 8cd37a40..abbde9c5 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -176,11 +176,10 @@ class PackageInfo(object): return node def verify(self): - ret = True - ret &= self.name - ret &= self.summary - ret &= len(self.paths) > 0 - return ret + if not self.name: return False + if not self.summary: return False + if len(self.paths) <= 0: return False + return True class SpecFile(XmlFile): """A class for reading/writing from/to a PSPEC (PISI SPEC) file.""" @@ -242,11 +241,10 @@ class SpecFile(XmlFile): def verify(self): """Verify PSPEC structures, are they what we want of them?""" - ret = True - ret &= self.source.verify() - ret &= len(self.packages)>1 + if not self.source.verify(): return False + if len(self.packages) <= 0: return False for x in self.packages: - ret &= x.verify() + if not x.verify(): return False return True def write(self, filename): diff --git a/tests/sandbox/sandbox.pspec b/tests/sandbox/sandbox.pspec index 5a7678de..a6d37898 100644 --- a/tests/sandbox/sandbox.pspec +++ b/tests/sandbox/sandbox.pspec @@ -13,7 +13,7 @@ meren@uludag.org.tr As-Is - + http://cekirdek.uludag.org.tr/~meren/sandbox.zip