• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(48)  |  Call(42)  |  Derive(0)  |  Import(6)
Function that can be used as copytree() ignore parameter.

Patterns is a sequence of glob-style patterns
that are used to exclude files

        def ignore_patterns(*patterns):
    """Function that can be used as copytree() ignore parameter.

    Patterns is a sequence of glob-style patterns
    that are used to exclude files"""
    def _ignore_patterns(path, names):
        ignored_names = []
        for pattern in patterns:
            ignored_names.extend(fnmatch.filter(names, pattern))
        return set(ignored_names)
    return _ignore_patterns
        


src/c/y/cynote-HEAD/cynote/make_release.py   cynote(Download)
# Script to make a copy of CyNote for zipping and release
 
import os
import sys
from shutil import rmtree, copytree, copy2, ignore_patterns
 
def cleanup_cynote(new_cynote):
def copy_cynote(release, new_cynote):
    # Step 2: Copy CyNote to release directory
    print "Step 2: Copy %s to release directory: %s" % (new_cynote, release)
    copytree(new_cynote, release,
             ignore = ignore_patterns('.svn', '.hg', '*.pyc'))
    print "Step 2 completed"
    print

src/c/y/cynote-HEAD/cynote/update_cynote.py   cynote(Download)
import os
import zipfile
import time
from shutil import rmtree, copytree, copy2, ignore_patterns
 
def cleanup_new_cynote(new_cynote):
    # Step 1.1: remove contents of new_cynote's database directory
def replace_cynote(old_cynote, new_cynote):
    # Step 6: Copy new cynote to replace deleted old cynote
    print "Step 6: Copy %s to replace deleted %s" % (new_cynote, old_cynote)
    copytree(new_cynote, old_cynote,
             ignore = ignore_patterns('.svn', '.hg', '*.pyc'))
    print "Step 6 completed"
    print

src/s/c/scrapy-HEAD/scrapy/utils/py26.py   scrapy(Download)
            raise NotImplementedError('cannot determine number of cpus')
 
if sys.version_info >= (2, 6):
    from shutil import copytree, ignore_patterns
else:
    try:
        WindowsError

src/s/c/Scrapy-0.10.3/scrapy/utils/py26.py   Scrapy(Download)
            raise NotImplementedError('cannot determine number of cpus')
 
if sys.version_info >= (2, 6):
    from shutil import copytree, ignore_patterns
else:
    try:
        WindowsError

src/u/s/usbp-HEAD/firmware/scripts/usbp_fx2_build.py   usbp(Download)
#!python
 
import sys, os, shutil, commands, getopt, glob
from shutil import ignore_patterns
from time import gmtime, strftime
 
# The FX2 code is relatively small, instead of using a makefile, scons

src/u/s/usbp-HEAD/firmware/scripts/build_fx2.py   usbp(Download)
#!python
 
import sys, os, shutil, commands, getopt, glob
from shutil import ignore_patterns
from time import gmtime, strftime
 
# The FX2 code is relatively small, instead of using a makefile, scons