X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2Fdolcon%2F__init__.py;fp=lib%2Fpython%2Fdolcon%2F__init__.py;h=0cb26baaf7c681b0473cf3a5bb4bb15c430fe14c;hb=54b4a8611d7b4dd760e4207f4a64932b580a431a;hp=8675b38b0cf67b061979987cf0782bc3e4800deb;hpb=42a9c63a4835e9990a2e6c0e1949b64ee4b318b2;p=doldaconnect.git diff --git a/lib/python/dolcon/__init__.py b/lib/python/dolcon/__init__.py index 8675b38..0cb26ba 100644 --- a/lib/python/dolcon/__init__.py +++ b/lib/python/dolcon/__init__.py @@ -99,3 +99,14 @@ def ecmds(*args): if resp.getcode() >= 500 and resp.getcode() < 600: raise ValueError, tuple(resp.extract()[0]) return resp + +def getresps(): + """A generator function which will iterate over all responses from + getresp. + """ + while True: + resp = getresp() + if resp is None: + break + else: + yield resp