1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-28 11:42:03 +03:00

python: Provide way to iterate over available shares.

This commit is contained in:
Jelmer Vernooij
2009-06-16 02:24:43 +02:00
parent f7ada51c29
commit 308de544f4
3 changed files with 53 additions and 2 deletions

View File

@ -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):