1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
ignore = shutil.ignore_patterns( "_notes", "old", "upload", "TEST", "test", "themes", "script", ".conf", "*~", "copie*", "*.lck", "*.bak" )
for root, dirs, files in os.walk( rootdir ):
logging.debug( "consumes : " + root )
# c'est un répertoire accepté, on le copie
website.copy_to_repository( REPOSITORY, root )
# on vérifie si il faut analyser les sous dossiers
ignored_names = ignore( root, dirs )
for aDir in dirs:
if aDir in ignored_names:
dirs.remove( aDir )
# on vérifie si il faut copier les fichiers
ignored_names = ignore( root, files )
for aFile in files:
if (aFile in ignored_names) == False:
website.copy_to_repository( REPOSITORY, root, aFile ) |
Partager