From: fuzzyray Date: Wed, 22 Sep 2010 20:56:38 +0000 (-0000) Subject: Merge from genscripts r451: douglasjanderson X-Git-Tag: gentoolkit-0.3.0_rc11~32 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bd90108ec189f75c0a4d7d9902f31bf777ea45b9;p=gentoolkit.git Merge from genscripts r451: douglasjanderson Revert r438 because the problem it addresses can be taken care of more robustly. Merge from genscripts r449: douglasjanderson Make some modifications to fix bug #309091 Merge from genscripts r438: brian.dolbec rework the dpendencies _parser() tok == '' trap in an attempt to trap the InvalidAtom error, add '' removal from matches in query, add more detail in the error from Atom, add a trap to skirt around a null atom in the ChangeLog class. Hopefully I either solved it or have it printing out more info this time. Merge from genscripts r436: brian.dolbec fix the error in the raising of the GentoolkitInvalidAtom error, find and change the info printed out in the error message to help track down the problem. Merge from genscripts r435: brian.dolbec modify the tok if statement as it didn't catch the error the user was using to print out additional info Merge from genscripts r434: brian.dolbec try to solve an svn diff! Invalid Atom, '' error a user is getting running equery depends. this should intercept the empty tok before and print out more useable info to determine if it should be an error or should be ignored, etc. svn path=/trunk/gentoolkit/; revision=802 --- diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies.py index f125006..feced63 100644 --- a/pym/gentoolkit/dependencies.py +++ b/pym/gentoolkit/dependencies.py @@ -27,7 +27,7 @@ from gentoolkit.query import Query # Classes # ======= -class Dependencies(CPV): +class Dependencies(Query): """Access a package's dependencies and reverse dependencies. Example usage: @@ -40,14 +40,8 @@ class Dependencies(CPV): [=dev-lang/python-2.5'>, , ...] """ - def __init__(self, cpv, op='', parser=None): - if isinstance(cpv, CPV): - self.__dict__.update(cpv.__dict__) - else: - CPV.__init__(self, cpv) - - self.operator = op - self.atom = self.operator + self.cpv + def __init__(self, query, parser=None): + Query.__init__(self, query) self.use = [] self.depatom = str() @@ -320,10 +314,16 @@ class Dependencies(CPV): if tok[0] == '!': # We're not interested in blockers continue - atom = Atom(tok) - if use_conditional is not None: - atom.use_conditional = use_conditional - result.append(atom) + # skip it if it's empty + if tok and tok != '': + atom = Atom(tok) + if use_conditional is not None: + atom.use_conditional = use_conditional + result.append(atom) + else: + message = "dependencies.py: _parser() found an empty " +\ + "dep string token for: %s, deps= %s" + raise errors.GentoolkitInvalidAtom(message %(self.cpv, deps)) return result