Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(294)  |  Call(209)  |  Derive(0)  |  Import(85)
Recursively remove an entire directory tree.

Any errors are ignored (apart from being reported to stdout if 'verbose'
is true).

        def remove_tree(directory, verbose=1, dry_run=0):
    """Recursively remove an entire directory tree.

    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    """
    from distutils.util import grok_environment_error
    global _path_created

    if verbose >= 1:
        log.info("removing '%s' (and everything under it)", directory)
    if dry_run:
        return
    cmdtuples = []
    _build_cmdtuple(directory, cmdtuples)
    for cmd in cmdtuples:
        try:
            cmd[0](cmd[1])
            # remove dir from cache if it's already there
            abspath = os.path.abspath(cmd[1])
            if abspath in _path_created:
                del _path_created[abspath]
        except (IOError, OSError), exc:
            log.warn(grok_environment_error(
                    exc, "error removing %s: " % directory))
        


src/b/d/bdist-venv2-0.1.3/bdist_venv2.py   bdist-venv2(Download)
from distutils import log
from distutils.core import Command
from distutils.dir_util import copy_tree, remove_tree, ensure_relative
from distutils.sysconfig import get_python_version
from distutils.util import get_platform
        # cleanup
        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)
 
    def fixup_shebangs(self, venv_dir):

src/s/n/snakefight-0.5/snakefight/command.py   snakefight(Download)
from StringIO import StringIO
from distutils import log
from distutils.dir_util import mkpath, remove_tree
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils.sysconfig import get_python_version
 
        if os.path.exists(self.lib_python):
            remove_tree(self.lib_python, dry_run=self.dry_run)
        mkpath(os.path.dirname(self.lib_python), dry_run=self.dry_run)
 

src/k/u/kuma-lib-HEAD/packages/ipython/IPython/Extensions/ipy_fsops.py   kuma-lib(Download)
        print "rm",p
        if os.path.isdir(p):
            distutils.dir_util.remove_tree(p, verbose = 1)
        else:
            os.remove(p)

src/c/h/Chocolatey-Packages-HEAD/mwrock-TfsDesktop/tools/sublime/Backup/20120727105608/AAAPackageDev/setup.py   Chocolatey-Packages(Download)
 
        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)
 
    def get_archive_files (self):

src/c/h/Chocolatey-Packages-HEAD/mwrock-TfsDesktop/tools/sublime/Backup/20120706164234/AAAPackageDev/setup.py   Chocolatey-Packages(Download)
 
        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)
 
    def get_archive_files (self):

src/c/h/Chocolatey-Packages-HEAD/mwrock-TfsDesktop/tools/sublime/Backup/20120520162633/AAAPackageDev/setup.py   Chocolatey-Packages(Download)
 
        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)
 
    def get_archive_files (self):

src/c/h/Chocolatey-Packages-HEAD/mwrock-TfsDesktop/tools/sublime/Backup/20120426035411/PowerShell/setup.py   Chocolatey-Packages(Download)
 
        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)
 
    def get_archive_files (self):

src/c/h/Chocolatey-Packages-HEAD/mwrock-TfsDesktop/tools/sublime/Backup/20120331054222/AAAPackageDev/setup.py   Chocolatey-Packages(Download)
 
        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)
 
    def get_archive_files (self):

src/c/h/Chocolatey-Packages-HEAD/mwrock-TfsDesktop/tools/sublime/Packages/PowershellUtils/setup.py   Chocolatey-Packages(Download)
 
        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)
 
    def get_archive_files (self):

src/c/h/Chocolatey-Packages-HEAD/mwrock-TfsDesktop/tools/sublime/Packages/PowerShell/setup.py   Chocolatey-Packages(Download)
 
        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)
 
    def get_archive_files (self):

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next