[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/LibSimpleHTTPServer.py,1.10,1.11

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Sat, 29 Jul 2000 16:26:06 +0300 (IDT)


On Sat, 29 Jul 2000, Mark Hammond wrote:

</F>
> and if I want to, how do I tweak the block size?

[Moshe]
> Just like you would in the old days: subclass SimpleHTTPServer, and
> substitute the copyfile method with a call to shutil.copyfile with a
> non-default size. (IOW, it's easier then what it was before).

[Mark]
> I think thats a little of an overkill.  It requires duplicating the entire
> method for the sake of one constant.

But Mark, the "entire method" is simply a call to shutil.copyfileobj
(well, that and a docstring). So "duplicating" it is the only thing
possible, unless you want to define a class variable "BLOCKSIZE". It can
be supported without duplicating the functionality of shutil.copyfileobj,
but that sure sounds like an overkill....
--
Moshe Zadka <moshez@math.huji.ac.il>
There is no IGLU cabal.
http://advogato.org/person/moshez