+def clean_dir(path):
+ """ Removes the contents of a directory, but not the directory itself
+ """
+ names = os.listdir(path)
+ for name in names:
+ fullname = os.path.join(path, name)
+ if os.path.isdir(fullname):
+ shutil.rmtree(fullname)
+ else:
+ os.remove(fullname)