def move_path_to_trash(path, preclean=True):
 for pkg_dir in context.pkgs_dirs:
  trash_dir = join(pkg_dir, u'.trash')
  try:
   makedirs(trash_dir)
  except (IOError, OSError) as e1:
   if (e1.errno != EEXIST):
    continue
  trash_file = join(trash_dir, text_type(uuid4()))
  try:
   rename(path, trash_file)
  except (IOError, OSError) as e:
   log.trace(u'Could not move %s to %s.\n%r', path, trash_file, e)
  else:
   log.trace(u'Moved to trash: %s', path)
   from ...core.linked_data import delete_prefix_from_linked_data
   delete_prefix_from_linked_data(path)
   return True
 return False

def move_path_to_trash ( path , preclean = True ) : for pkg_dir in context . pkgs_dirs : trash_dir = join ( pkg_dir , u'.trash' ) try : makedirs ( trash_dir ) except ( IOError , OSError ) as e1 : if ( e1 . errno != EEXIST ) : continue trash_file = join ( trash_dir , text_type ( uuid4 ( ) ) ) try : rename ( path , trash_file ) except ( IOError , OSError ) as e : log . trace ( u'Could not move %s to %s.\n%r' , path , trash_file , e ) else : log . trace ( u'Moved to trash: %s' , path ) from ... core . linked_data import delete_prefix_from_linked_data delete_prefix_from_linked_data ( path ) return True return False
move a path to the trash .