From 54b4a8611d7b4dd760e4207f4a64932b580a431a Mon Sep 17 00:00:00 2001 From: fredrik Date: Fri, 1 Dec 2006 02:11:25 +0000 Subject: [PATCH] Add getresps. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@775 959494ce-11ee-0310-bf91-de5d638817bd --- lib/python/dolcon/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.11.0