Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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