Created
March 3, 2010 04:51
-
-
Save chromakode/320330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _iter_driver_output(self): | |
while self.driver_stack: | |
curdriver = self.driver | |
# Iterate over the current driver until it changes. | |
for output in curdriver.get_input(): | |
yield output | |
# If the driver has changed, stop iterating over the old one. | |
if self.driver is not curdriver: | |
break | |
else: | |
# Driver finished. | |
if len(self.driver_stack) == 1: | |
# If it's the final one, finish iterating. | |
break | |
else: | |
# If it's not the final one, pop it off the stack. | |
self.driver_stack.pop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment