Pops the tag stack up to and including the most recent instance of the given tag. If inclusivePop is false, pops the tag stack up to but *not* including the most recent instqance of the given tag.
(self, name, inclusivePop=True)
| 1260 | |
| 1261 | |
| 1262 | def _popToTag(self, name, inclusivePop=True): |
| 1263 | """Pops the tag stack up to and including the most recent |
| 1264 | instance of the given tag. If inclusivePop is false, pops the tag |
| 1265 | stack up to but *not* including the most recent instqance of |
| 1266 | the given tag.""" |
| 1267 | #print "Popping to %s" % name |
| 1268 | if name == self.ROOT_TAG_NAME: |
| 1269 | return |
| 1270 | |
| 1271 | numPops = 0 |
| 1272 | mostRecentTag = None |
| 1273 | for i in range(len(self.tagStack)-1, 0, -1): |
| 1274 | if name == self.tagStack[i].name: |
| 1275 | numPops = len(self.tagStack)-i |
| 1276 | break |
| 1277 | if not inclusivePop: |
| 1278 | numPops = numPops - 1 |
| 1279 | |
| 1280 | for i in range(0, numPops): |
| 1281 | mostRecentTag = self.popTag() |
| 1282 | return mostRecentTag |
| 1283 | |
| 1284 | def _smartPop(self, name): |
| 1285 |
no test coverage detected