Clear the symlinks for a feature in the symlinked path
489752
def clear_feature_symlinks(self, feature_name):
        
        logger.debug("Clearing feature symlinks for %s" % feature_name)
        feature_path = self.install_directory(feature_name)
        for d in ('bin', 'lib'):
            if os.path.exists(os.path.join(self.root_dir, d)):
                for link in os.listdir(os.path.join(self.root_dir, d)):
                    path = os.path.join(self.root_dir, d, link)
                    if feature_path in os.path.realpath(path):
                        getattr(self, 'remove_from_%s' % d)(link)
942882
def _resolve_symlink(path, max_depth=64):
    '''
    
    '''
    if sys.getwindowsversion().major < 6:
        raise SaltInvocationError('Symlinks are only supported on Windows Vista or later.')

    # make sure we don't get stuck in a symlink loop!
    paths_seen = set((path, ))
    cur_depth = 0
    while is_link(path):
        path = readlink(path)
        if path in paths_seen:
            raise CommandExecutionError('The given path is involved in a symlink loop.')
        paths_seen.add(path)
        cur_depth += 1
        if cur_depth > max_depth:
            raise CommandExecutionError('Too many levels of symbolic links.')

    return path
253783
def clear(self):
        
        for variable in self._project.variables.list(all=True):
            variable.delete()
240446
def remove(self, rel_path, propagate=False):
        ''''''
        repo_path = os.path.join(self.cache_dir, rel_path)

        c = self.database.cursor()
        c.execute("DELETE FROM  files WHERE path = ?", (rel_path,))

        if os.path.exists(repo_path):
            os.remove(repo_path)

        self.database.commit()

        if self.upstream and propagate:
            self.upstream.remove(rel_path, propagate)
805656
def cleanup(self):
        
        if getattr(self._finalizer, "detach", None) and self._finalizer.detach():
            if os.path.exists(self.path):
                try:
                    rmtree(self.path)
                except OSError:
                    pass
                else:
                    self.path = None
1063054
def clear_dir(self):
        """"""
        self.stdout.write("Deleting contents of '{}'.".format(self.destination_path))

        for filename in os.listdir(self.destination_path):
            if os.path.isfile(filename) or os.path.islink(filename):
                os.remove(filename)
            elif os.path.isdir(filename):
                shutil.rmtree(filename)
71969
def clean(args):
    
    p = OptionParser(clean.__doc__)
    opts, args = p.parse_args(args)

    for link_name in os.listdir(os.getcwd()):
        if not op.islink(link_name):
            continue
        logging.debug("remove symlink `{0}`".format(link_name))
        os.unlink(link_name)
1215210
def cleanup_bundle():
    
    paths = ['./vendored', './bundle.zip']
    for path in paths:
        if os.path.exists(path):
            log.debug("Deleting %s..." % path)
            if os.path.isdir(path):
                shutil.rmtree(path)
            else:
                os.remove(path)
605020
def remove(self):
        
        for cgroup in self.paths:
            remove_cgroup(cgroup)

        del self.paths
        del self.per_subsystem
213321
protected function removePhars()
    {
        $path = \Yii::getAlias($this->module->path);

        foreach (['', '.gz', '.bz2'] as $extension) {
            $fullPath = $path . DIRECTORY_SEPARATOR . $extension;
            if (file_exists($fullPath) === true) {
                \Phar::unlinkArchive($fullPath);
            }
        }
    }
113953
public void clearSelectedFeatures() {
		List<Feature> clone = new LinkedList<Feature>(selectedFeatures.values());
		for (Feature feature : clone) {
			selectedFeatures.remove(feature.getId());
			handlerManager.fireEvent(new FeatureDeselectedEvent(feature));
		}
	}
1041381
def clear(self):
        """"""
        super(LazyConfig, self).clear()
        self._lazy_suffix = []
        self._lazy_prefix = []
842839
def clear(self):
        """"""
        super(Router, self).clear()
        for name in self.todo:
            filename = os.path.join(self.migrate_dir, name + '.py')
            os.remove(filename)
310257
def clean_caches(path):
    

    for dirname, subdirlist, filelist in os.walk(path):

        for f in filelist:
            if f.endswith('pyc'):
                try:
                    os.remove(os.path.join(dirname, f))
                except FileNotFoundError:
                    pass

        if dirname.endswith('__pycache__'):
            shutil.rmtree(dirname)
663288
def cleanup_environment():
    
    SERV.terminate()
    shutil.rmtree(TMP_PATH)
    if os.path.exists(TMP_PATH):
        os.rmdir(TMP_PATH)

    global TMP_PATH
    TMP_PATH = None
1054239
def clear(self):
        
        self._xroot = ElementTree.Element('settings')
        self._xroot.set('version', '1.0')
        self._xstack = [self._xroot]
774890
def disable(self):
        
        log = logging.getLogger('ipsv.models.sites.site')
        sites_enabled_path = _cfg.get('Paths', 'NginxSitesEnabled')
        symlink_path = os.path.join(sites_enabled_path, '{domain}-{fn}.conf'.format(domain=self.domain.name,
                                                                                    fn=self.slug))
        log.debug('Symlink path: %s', symlink_path)
        if os.path.islink(symlink_path):
            log.info('Removing configuration symlink: %s', symlink_path)
            os.unlink(symlink_path)

        self.enabled = 0
        Session.commit()