From: fredrik Date: Fri, 1 Dec 2006 02:11:25 +0000 (+0000) Subject: Add getresps. X-Git-Tag: 0.3~149 X-Git-Url: http://dolda2000.com/gitweb/?p=doldaconnect.git;a=commitdiff_plain;h=54b4a8611d7b4dd760e4207f4a64932b580a431a Add getresps. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@775 959494ce-11ee-0310-bf91-de5d638817bd --- 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