From 308de544f4dd1e23197d3b6d3be85cef1f5f9ded Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 16 Jun 2009 02:24:43 +0200 Subject: python: Provide way to iterate over available shares. --- source4/scripting/python/samba/shares.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/shares.py b/source4/scripting/python/samba/shares.py index 622c3b6486..89a312e855 100644 --- a/source4/scripting/python/samba/shares.py +++ b/source4/scripting/python/samba/shares.py @@ -41,8 +41,11 @@ class SharesContainer(object): return len(self._lp)-1 return len(self._lp) + def keys(self): + return [name for name in self._lp.services() if name != "global"] + def __iter__(self): - return self.lp.services() + return iter(self.keys()) class Share(object): -- cgit