MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / listShares

Method listShares

pager_lib/smb/SMBProtocol.py:166–178  ·  view source on GitHub ↗

Retrieve a list of shared resources on remote server. :param integer/float timeout: Number of seconds that pysmb will wait before raising *SMBTimeout* via the returned *Deferred* instance's *errback* method. :return: A *twisted.internet.defer.Deferred* instance. The callbac

(self, timeout = 30)

Source from the content-addressed store, hash-verified

164 #
165
166 def listShares(self, timeout = 30):
167 """
168 Retrieve a list of shared resources on remote server.
169
170 :param integer/float timeout: Number of seconds that pysmb will wait before raising *SMBTimeout* via the returned *Deferred* instance's *errback* method.
171 :return: A *twisted.internet.defer.Deferred* instance. The callback function will be called with a list of :doc:`smb.base.SharedDevice<smb_SharedDevice>` instances.
172 """
173 if not self.instance:
174 raise NotConnectedError('Not connected to server')
175
176 d = defer.Deferred()
177 self.instance._listShares(d.callback, d.errback, timeout)
178 return d
179
180 def listPath(self, service_name, path,
181 search = SMB_FILE_ATTRIBUTE_READONLY | SMB_FILE_ATTRIBUTE_HIDDEN | SMB_FILE_ATTRIBUTE_SYSTEM | SMB_FILE_ATTRIBUTE_DIRECTORY | SMB_FILE_ATTRIBUTE_ARCHIVE | SMB_FILE_ATTRIBUTE_INCL_NORMAL,

Callers

nothing calls this directly

Calls 1

NotConnectedErrorClass · 0.70

Tested by

no test coverage detected