Empty the recycle bin or preview its size. If the recycle bin is empty, it is not emptied again to avoid an error. Keyword arguments: path -- A drive, folder or None. None refers to all recycle bins. really_delete -- If True, then delete. If False, then just preview.
(path, really_delete)
| 600 | |
| 601 | |
| 602 | def empty_recycle_bin(path, really_delete): |
| 603 | """Empty the recycle bin or preview its size. |
| 604 | |
| 605 | If the recycle bin is empty, it is not emptied again to avoid an error. |
| 606 | |
| 607 | Keyword arguments: |
| 608 | path -- A drive, folder or None. None refers to all recycle bins. |
| 609 | really_delete -- If True, then delete. If False, then just preview. |
| 610 | """ |
| 611 | (bytes_used, num_files) = shell.SHQueryRecycleBin(path) |
| 612 | if really_delete and num_files > 0: |
| 613 | # Trying to delete an empty Recycle Bin on Vista/7 causes a |
| 614 | # 'catastrophic failure' |
| 615 | flags = shellcon.SHERB_NOSOUND | shellcon.SHERB_NOCONFIRMATION | shellcon.SHERB_NOPROGRESSUI |
| 616 | shell.SHEmptyRecycleBin(None, path, flags) |
| 617 | return bytes_used |
| 618 | |
| 619 | |
| 620 | def get_clipboard_paths(): |
no outgoing calls