def Purge(self, amt_to_free, callback):
print "Purging", amt_to_free, "bytes..."
# we ignore amt_to_free - it is generally what we returned for
# GetSpaceUsed
try:
for d in self._GetDirectories():
os.path.walk(d, self._WalkCallback, (callback, None))
except pythoncom.error, (hr, msg, exc, arg):
# This will be raised by the callback when the user selects 'cancel'.
if hr != winerror.E_ABORT:
raise # that's the documented error code!
print "User cancelled the operation"
评论列表
文章目录