A Python UPnP Media Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
512 B

  1. #!/usr/bin/env python
  2. # Copyright 2006 John-Mark Gurney <jmg@funkthat.com>
  3. __version__ = '$Change$'
  4. # $Id$
  5. import binascii
  6. import os
  7. import twisted.python.zipstream
  8. import zipfile
  9. from zipfile import *
  10. __all__ = zipfile.__all__
  11. class ZipFile(twisted.python.zipstream.ChunkingZipFile):
  12. def readiter(self, name, blksize=16384):
  13. """Return file bytes (as a string) for name."""
  14. #print 'ri:', `self`, `name`
  15. fp = self.readfile(name)
  16. while True:
  17. d = fp.read(blksize)
  18. if not d:
  19. break
  20. yield d