MCPcopy Index your code
hub / github.com/RustPython/RustPython / stat

Method stat

Lib/poplib.py:221–242  ·  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

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

Callers 15

_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
make_archiveFunction · 0.45
existsFunction · 0.45

Calls 6

_shortcmdMethod · 0.95
reprFunction · 0.85
lenFunction · 0.85
error_protoClass · 0.70
printFunction · 0.50
splitMethod · 0.45

Tested by

no test coverage detected