Changeset View
Changeset View
Standalone View
Standalone View
pykolab/auth/__init__.py
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | def disconnect(self, domain=None): | ||||
if not self._auth or self._auth == None: | if not self._auth or self._auth == None: | ||||
return | return | ||||
self._auth._disconnect() | self._auth._disconnect() | ||||
del self._auth | del self._auth | ||||
self._auth = None | self._auth = None | ||||
def find_folder_resource(self, folder): | |||||
""" | |||||
Find one or more resources corresponding to the shared folder name. | |||||
""" | |||||
if not self._auth or self._auth == None: | |||||
self.connect() | |||||
result = self._auth.find_folder_resource(folder) | |||||
if isinstance(result, list) and len(result) == 1: | |||||
return result[0] | |||||
else: | |||||
return result | |||||
def find_recipient(self, address, domain=None): | def find_recipient(self, address, domain=None): | ||||
""" | """ | ||||
Find one or more entries corresponding to the recipient address. | Find one or more entries corresponding to the recipient address. | ||||
""" | """ | ||||
if not domain == None and not self.domain == domain: | if not domain == None and not self.domain == domain: | ||||
self.connect(domain=domain) | self.connect(domain=domain) | ||||
if not self._auth or self._auth == None: | if not self._auth or self._auth == None: | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |