MCPcopy Index your code
hub / github.com/python/cpython / stat

Method stat

Lib/poplib.py:223–244  ·  view source on GitHub ↗

Get mailbox status. Result is tuple of 2 ints (message count, mailbox size)

(self)

Source from the content-addressed store, hash-verified

221
222
223 def stat(self):
224 """Get mailbox status.
225
226 Result is tuple of 2 ints (message count, mailbox size)
227 """
228 retval = self._shortcmd('STAT')
229 rets = retval.split()
230 if self._debugging: print('*stat*', repr(rets))
231
232 # Check if the response has enough elements
233 # RFC 1939 requires at least 3 elements (+OK, message count, mailbox size)
234 # but allows additional data after the required fields
235 if len(rets) < 3:
236 raise error_proto("Invalid STAT response format")
237
238 try:
239 numMessages = int(rets[1])
240 sizeMessages = int(rets[2])
241 except ValueError:
242 raise error_proto("Invalid STAT response data: non-numeric values")
243
244 return (numMessages, sizeMessages)
245
246
247 def list(self, which=None):

Callers 15

file_mtimeFunction · 0.45
mainFunction · 0.45
_copy_archiveFunction · 0.45
_fwalkFunction · 0.45
compile_fileFunction · 0.45
poplib.pyFile · 0.45
synopsisFunction · 0.45
_samefileFunction · 0.45
_statFunction · 0.45
copystatFunction · 0.45
_copytreeFunction · 0.45
_rmtree_safe_fd_stepFunction · 0.45

Calls 3

_shortcmdMethod · 0.95
error_protoClass · 0.70
splitMethod · 0.45

Tested by

no test coverage detected