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

Method remove_folder

Lib/mailbox.py:1205–1215  ·  view source on GitHub ↗

Delete the named folder, which must be empty.

(self, folder)

Source from the content-addressed store, hash-verified

1203 factory=self._factory)
1204
1205 def remove_folder(self, folder):
1206 """Delete the named folder, which must be empty."""
1207 path = os.path.join(self._path, folder)
1208 entries = os.listdir(path)
1209 if entries == ['.mh_sequences']:
1210 os.remove(os.path.join(path, '.mh_sequences'))
1211 elif entries == []:
1212 pass
1213 else:
1214 raise NotEmptyError('Folder not empty: %s' % self._path)
1215 os.rmdir(path)
1216
1217 def get_sequences(self):
1218 """Return a name-to-key-list dictionary to define each sequence."""

Callers 2

Calls 5

NotEmptyErrorClass · 0.85
listdirMethod · 0.80
rmdirMethod · 0.80
joinMethod · 0.45
removeMethod · 0.45

Tested by 2