diff options
author | Peter A. Bigot <pabigot@users.sourceforge.net> | 2010-05-29 14:29:49 -0500 |
---|---|---|
committer | Peter A. Bigot <pabigot@users.sourceforge.net> | 2010-05-29 14:29:49 -0500 |
commit | c1e3a9ef8600913a7bbf541089afe8813be885f8 (patch) | |
tree | 65112c6cd11a1207e6b233bcba0d44bdf9c20c7d /pyxb/binding | |
parent | ba78403985716b10ed20bf381bc749cfaf4c9865 (diff) |
Fix misplaced incrementCount, now handled in notifyFailure
Diffstat (limited to 'pyxb/binding')
-rw-r--r-- | pyxb/binding/content.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pyxb/binding/content.py b/pyxb/binding/content.py index 9e628b7..5d635d1 100644 --- a/pyxb/binding/content.py +++ b/pyxb/binding/content.py @@ -681,6 +681,7 @@ class ChoiceState (ContentState_mixin): def _verifyComplete (self, parent_particle_state): rv = True + #print 'CS.VC %s: %s' % (self, self.__activeChoice) if self.__activeChoice is None: for choice in self.__choices: try: @@ -688,9 +689,8 @@ class ChoiceState (ContentState_mixin): return except Exception, e: pass - raise MissingContentError('choice') + raise pyxb.MissingContentError('choice') self.__activeChoice.verifyComplete() - parent_particle_state.incrementCount() def notifyFailure (self, sub_state, particle_ok): #print 'CS.NF %s %s' % (self, particle_ok) @@ -715,9 +715,13 @@ class ParticleState (pyxb.cscRoot): self.__tryAccept = True def verifyComplete (self): + # @TODO@ Set a flag so we can make verifyComplete safe to call + # multiple times? + #print 'PS.VC %s entry' % (self,) if not self.__particle.satisfiesOccurrences(self.__count): self.__termState._verifyComplete(self) if not self.__particle.satisfiesOccurrences(self.__count): + #print 'PS.VC %s incomplete' % (self,) raise pyxb.MissingContentError('incomplete') if self.__parentState is not None: self.__parentState.notifyFailure(self, True) |