Clean up build files
331780
def clean(all=False, docs=False, dist=False, extra=None):
    """"""

    run('find . -type f -name "*.py[co]" -delete')
    run('find . -type d -name "__pycache__" -delete')

    patterns = ['build', '*.egg-info/']
    if all or docs:
        patterns.append('doc/build/*')
    if all or dist:
        patterns.append('dist')
    if extra:
        patterns.append(extra)
    for pattern in patterns:
        run('rm -rf {}'.format(pattern))
1090803
def cleanup(self):
        """"""
        shutil.rmtree(self.name, onerror=lambda *a: os.chmod(a[1], __import__('stat').S_IWRITE) or os.unlink(a[1]))
        if os.path.exists(self.name):
            raise IOError(17, "File exists: '{}'".format(self.name))
307584
def clean_conf_folder(self, locale):
        """"""
        dirname = self.configuration.get_messages_dir(locale)
        dirname.removedirs_p()
888335
public function clearBuildTs()
    {
        $this->_io->verbose('Clearing build timestamp.');
        $writer = $this->factory->writer();
        $writer->clearTimestamps();
    }
153681
def clean(self, force=False):
        """"""

        if self.is_finalized and not force:
            self.warn("Can't clean; bundle is finalized")
            return False

        self.log('---- Cleaning ----')
        self.state = self.STATES.CLEANING
        self.dstate = self.STATES.BUILDING

        self.commit()

        self.clean_sources()
        self.clean_tables()
        self.clean_partitions()
        self.clean_build()
        self.clean_files()
        self.clean_ingested()
        self.clean_build_state()
        self.clean_progress()

        self.state = self.STATES.CLEANED

        self.commit()

        return True
1000167
def clean(dry_run='n'):
    """"""
    file_patterns = ['*.pyc', '*.pyo', '*~']
    dir_patterns = ['__pycache__']
    recursive_pattern_delete(project_paths.root, file_patterns, dir_patterns, dry_run=bool(dry_run.lower() == 'y'))
294980
function clean() {
    swig.log.info('', 'Cleaning the /public directory...');

    let paths = [
      './public/**/{target}/**/*',
      '!./public/**/{target}/**/config',
      '!./public/**/{target}/**/config/**/*',
      '!./public/**/{target}/**/src',
      '!./public/**/{target}/**/src/**/*',
      '!./public/css/{target}/main.less',
      '!./public/spec/{target}/**/*'
    ];

    paths = _.map(paths, p => p.replace('{target}', swig.pkg.name));
    const files = glob.sync(paths);

    swig.log.verbose(`[clean] ${files.length} files found at: `);
    swig.log.verbose(paths);

    _.each(files, (file) => {
      swig.log.verbose(`[clean] removing: ${file}`);
      rimraf.sync(path.normalize(file));
    });
  }
548746
def delete(build_folder):
    
    if _meta_.del_build in ["on", "ON"] and os.path.exists(build_folder):
        shutil.rmtree(build_folder)
449439
def _clean():
    
    LOGGER.info('Cleaning project directory...')
    folders_to_cleanup = [
        '.eggs',
        'build',
        f'{config.PACKAGE_NAME()}.egg-info',
    ]
    for folder in folders_to_cleanup:
        if os.path.exists(folder):
            LOGGER.info('\tremoving: %s', folder)
            shutil.rmtree(folder)
1181857
def run_cleanup(build_ext_cmd):
    
    if not build_ext_cmd.inplace:
        return

    bezier_dir = os.path.join("src", "bezier")
    shutil.move(os.path.join(build_ext_cmd.build_lib, LIB_DIR), bezier_dir)
    shutil.move(os.path.join(build_ext_cmd.build_lib, DLL_DIR), bezier_dir)
1227059
def cleanup():
    
    script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__))
    script_dir = os.path.realpath(os.path.join(script_dir, ".."))
    shutil.rmtree(os.path.join(script_dir, "dist"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "tmp"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh", "tmp"), ignore_errors=True)
196879
def clean_all(ctx, dry_run=False):
    
    cleanup_dirs(ctx.clean_all.directories or [], dry_run=dry_run)
    cleanup_dirs(ctx.clean_all.extra_directories or [], dry_run=dry_run)
    cleanup_files(ctx.clean_all.files or [], dry_run=dry_run)
    cleanup_files(ctx.clean_all.extra_files or [], dry_run=dry_run)
    execute_cleanup_tasks(ctx, cleanup_all_tasks, dry_run=dry_run)
    clean(ctx, dry_run=dry_run)
695610
def clean():
    ''''''

    basedir = dirname(__file__)

    print(cyan('delete temp files and dirs for packaging'))
    local(flo(
        'rm -rf  '
        '{basedir}/.eggs/  '
        '{basedir}/fabsetup.egg-info/  '
        '{basedir}/dist  '
        '{basedir}/README  '
        '{basedir}/build/  '
    ))

    print(cyan('\ndelete temp files and dirs for editing'))
    local(flo(
        'rm -rf  '
        '{basedir}/.cache  '
        '{basedir}/.ropeproject  '
    ))

    print(cyan('\ndelete bytecode compiled versions of the python src'))
    # cf. http://stackoverflow.com/a/30659970
    local(flo('find  {basedir}/fabsetup  '
              'fabfile*  ') +
          '\( -name \*pyc -o -name \*.pyo -o -name __pycache__ '
          '-o -name \*.so -o -name \*.o -o -name \*.c \) '
          '-prune '
          '-exec rm -rf {} + || true')
164318
def clean_dir(root):
    ''''''
    for x in root.walkdirs('.*', errors='ignore'):
        x.rmtree()
    for x in root.walkdirs('_*', errors='ignore'):
        x.rmtree()

    for x in root.walkfiles('.*', errors='ignore'):
        x.remove()
    for x in root.walkfiles('_*', errors='ignore'):
        x.remove()
107726
function cleanupFsStorage(conf) {
    if (conf.cleanupStartup) {
        const storagePath = conf.storage,
              files = fs.readdirSync(storagePath);

        files.forEach((file) => {
            try {
                const filePath = utils.filePath(file, storagePath);
                fs.removeSync(filePath, {force: true});
            } catch (err) {}
        });
    }
}
619077
def clean(context: Context, delete_dependencies: bool = False):
    
    paths = [context.app.asset_build_path, context.app.collected_assets_path, context.app.govuk_templates_path,
             'docker-compose.yml', 'package.json', 'package-lock.json', 'webpack.config.js']
    context.shell('rm -rf %s' % paths_for_shell(paths))
    context.shell('find %s -name "*.pyc" -or -name __pycache__ -delete' % context.app.django_app_name)

    if delete_dependencies:
        context.info('Cleaning app %s dependencies' % context.app.name)
        paths = ['node_modules', 'venv']
        context.shell('rm -rf %s' % paths_for_shell(paths))
1035756
def cleanup_log_files(outputfile):
    """"""
    d = os.path.dirname(os.path.abspath(outputfile))
    logfiles = [f for f in os.listdir(d) if f.endswith('ogg.log')]
    for f in logfiles:
        os.remove(f)