On Tue, Apr 22, 2008 at 7:04 PM, Steven Bethard <[EMAIL PROTECTED]>
wrote:
> > The callable takes the src directory + its content as a list, and
> > returns filter eligible for exclusion
>
> FWIW, that looks better to me.
>
> > That makes me wonder, like Alexander said on the bug tracker:
> >
On Tue, Apr 22, 2008 at 1:56 AM, Tarek Ziadé <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 21, 2008 at 2:25 AM, Steven Bethard <[EMAIL PROTECTED]> wrote:
> > On Sun, Apr 20, 2008 at 4:15 PM, Tarek Ziadé <[EMAIL PROTECTED]> wrote:
> > > I have submitted a patch for review here:
> http://bugs.python.or
On Mon, Apr 21, 2008 at 2:25 AM, Steven Bethard
<[EMAIL PROTECTED]> wrote:
>
> On Sun, Apr 20, 2008 at 4:15 PM, Tarek Ziadé <[EMAIL PROTECTED]> wrote:
> > I have submitted a patch for review here: http://bugs.python.org/issue2663
> >
> > glob-style patterns or a callable (for complex cases) can
Steven Bethard wrote:
I'm not a big fan of the sequence-or-callable argument. Why not just
make it a callable argument, and supply a utility function
Or have two different keyword arguments, one for a sequence
and one for a callable.
--
Greg
___
Pyth
On Sun, Apr 20, 2008 at 5:25 PM, Steven Bethard
<[EMAIL PROTECTED]> wrote:
>
> On Sun, Apr 20, 2008 at 4:15 PM, Tarek Ziadé <[EMAIL PROTECTED]> wrote:
> > I have submitted a patch for review here: http://bugs.python.org/issue2663
> >
> > glob-style patterns or a callable (for complex cases) can
The pattern matching uses the src_dir to call glob.glob(), which returns
the list of files to be excluded. That's why I added within the
copytree() function.
To make an excluding_patterns work, it could be coded like this::
def excluding_patterns(*patterns):
def _excluding_patterns(fi
On Sun, 20 Apr 2008, Steven Bethard wrote:
On Sun, Apr 20, 2008 at 4:15 PM, Tarek Ziadé <[EMAIL PROTECTED]> wrote:
I have submitted a patch for review here: http://bugs.python.org/issue2663
glob-style patterns or a callable (for complex cases) can be provided
to filter out files or directori
On Sun, Apr 20, 2008 at 4:15 PM, Tarek Ziadé <[EMAIL PROTECTED]> wrote:
> I have submitted a patch for review here: http://bugs.python.org/issue2663
>
> glob-style patterns or a callable (for complex cases) can be provided
> to filter out files or directories.
I'm not a big fan of the sequence-o
I have submitted a patch for review here: http://bugs.python.org/issue2663
glob-style patterns or a callable (for complex cases) can be provided
to filter out files or directories.
Regards
Tarek
___
Python-Dev mailing list
Python-Dev@python.org
http://
On Thu, Apr 17, 2008 at 7:06 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> Sounds like a neat little feature. Looking forward to it. Maybe the
> most useful use case would be to provide glob-style patterns for
> skipping files or directories (and their contents).
Alright I will work on it th
On 17/04/2008, Tarek Ziadé <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> shutil.copytree is very convenient to make recursive copies, but
> os.walk has to be used everytime some filtering
> has to be done on the files copied., if you want to avoid copying some
> files.
>
> The code pattern with os.walk is
Sounds like a neat little feature. Looking forward to it. Maybe the
most useful use case would be to provide glob-style patterns for
skipping files or directories (and their contents).
--Guido
On Thu, Apr 17, 2008 at 9:52 AM, Tarek Ziadé <[EMAIL PROTECTED]> wrote:
> Hi,
>
> shutil.copytree is ve
> - copying a source to a target, but the pyc/pyo file
> def filtering(source, target):
> return os.path.splitext(filename) not in ('.pyc', '.pyo')
>
> shutil.copytree(source, target, filter_=filtering)
> -
oups, made a mistake in my example:
def fi
Hi,
shutil.copytree is very convenient to make recursive copies, but
os.walk has to be used everytime some filtering
has to be done on the files copied., if you want to avoid copying some files.
The code pattern with os.walk is pretty talkative :
- copying a source folder to
14 matches
Mail list logo