tarek ziadé vgwilzhzzsgmailcom pattern matching uses src_dir call globglob returns list files excluded thats added within copytree function make excluding_patterns work could coded like def excluding_patternspatterns def _excluding_patternsfilepath exclude_files dir_ ospathdirnamefilepath pattern patterns pattern ospathjoindir_ pattern exclude_filesextendglobglobpattern return path exclude_files return _excluding_patterns see performance issues glob function called within loop test file folder def copytreesrc dst exclude name names srcname ospathjoinsrc name excludesrcname continue adding beginning copytree function would better performance means callable return list matching files instead match result def excluding_patternspatterns def _excluding_patternspath exclude_files pattern patterns pattern ospathjoindir_ pattern exclude_filesextendglobglobpattern return exclude_files copytree def copytreesrc dst exclude excluded excludesrc name names srcname ospathjoinsrc name srcname excluded continue means people wants implement callable provide function returns list excluded files therefore wont free implement want could two parameters one globstyle sequence one callable able use appropriate places function think would make function signature rather heavy def copytreesrc dst exclude_patternsnone exclude_functionnone thats would favor sequenceorcallable argument even admit pretiest way present argument regards tarek mon apr 21 2008 238 isaac morland wrote sun 20 apr 2008 steven bethard wrote sun apr 20 2008 415 pm tarek ziadé wrote submitted patch review httpbugspythonorgissue2663 globstyle patterns callable complex cases provided filter files directories im big fan sequenceorcallable argument make callable argument supply utility function write something like exclude_func shutilexcluding_patternstmp test_dir2 shutilcopytreesrc_dir dst_dir excludeexclude_func even glob pattern filter considered useful enough worth specialcasing glob capability also exposed via something like excluding_patterns constructor additionally function called another function intended use callable argument something like files matching glob patterns except matching nonglobexpressible condition also files matching second nonglobexpressible condition becomes painful glob part essentially needs reimplemented isaac morland cscf web guru dc 2554c x36650 www software specialist tarek ziadé association afpy wwwafpyorg blog fr httpprogrammationpythonorg blog en httptarekziadewordpresscom _______________________________________________ pythondev mailing list zvlllneumpythonorg httpmailpythonorgmailmanlistinfopythondev unsubscribe httpmailpythonorgmailmanoptionspythondevpythondev40tangomucom thu 07 aug 2008 230933 0200 pythondev smarter shutilcopytree