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

Method remove_folder

Lib/mailbox.py:1212–1222  ·  view source on GitHub ↗

Delete the named folder, which must be empty.

(self, folder)

Source from the content-addressed store, hash-verified

1210 factory=self._factory)
1211
1212 def remove_folder(self, folder):
1213 """Delete the named folder, which must be empty."""
1214 path = os.path.join(self._path, folder)
1215 entries = os.listdir(path)
1216 if entries == ['.mh_sequences']:
1217 os.remove(os.path.join(path, '.mh_sequences'))
1218 elif entries == []:
1219 pass
1220 else:
1221 raise NotEmptyError('Folder not empty: %s' % self._path)
1222 os.rmdir(path)
1223
1224 def get_sequences(self):
1225 """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