Example #1
0
def deleteTree(directory):
   """Remove directory even if not empty (retry for 10 seconds if remove fails)"""

   if (os.path.isdir(directory)):
      try:
         tools.tryWhile(lambda : shutil.rmtree(directory))
      except:
         print "Unable to delete ", directory, " path"
         raise
Example #2
0
def deleteTree(directory):
    """Remove directory even if not empty (retry for 10 seconds if remove fails)"""

    if (os.path.isdir(directory)):
        try:
            tools.tryWhile(lambda: shutil.rmtree(directory))
        except:
            print "Unable to delete ", directory, " path"
            raise
Example #3
0
def deleteFile(file):
   """Remove file (retry for 10 seconds if remove fails)"""

   if (os.path.isfile(file)):
      try:
         tools.tryWhile(lambda : os.remove(file))
      except:
         print "Unable to delete ", file, " file"
         raise
Example #4
0
def deleteFile(file):
    """Remove file (retry for 10 seconds if remove fails)"""

    if (os.path.isfile(file)):
        try:
            tools.tryWhile(lambda: os.remove(file))
        except:
            print "Unable to delete ", file, " file"
            raise