All Samples(546) | Call(515) | Derive(0) | Import(31)
copy data from file-like object fsrc to file-like object fdst
def copyfileobj(fsrc, fdst, length=16*1024):
"""copy data from file-like object fsrc to file-like object fdst"""
while 1:
buf = fsrc.read(length)
if not buf:
break
fdst.write(buf)
the `length` parameter of
:func:`shutil.copyfileobj`.
"""
from shutil import copyfileobj
close_dst = False
if isinstance(dst, basestring):
dst = file(dst, 'wb')
close_dst = True
try:
copyfileobj(self.stream, dst, buffer_size)
src/u/l/uliweb-HEAD/uliweb/lib/werkzeug/utils.py uliweb(Download)
def save(self, dst, buffer_size=16384):
"""Save the file to a destination path or file object. If the
destination is a file object you have to close it yourself after the
call. The buffer size is the number of bytes held in the memory
during the copy process. It defaults to 16KB.
"""
from shutil import copyfileobj
close_dst = False
if isinstance(dst, basestring):
dst = file(dst, 'wb')
close_dst = True
try:
copyfileobj(self.stream, dst, buffer_size)
src/w/e/webnest-HEAD/env/lib/python2.6/site-packages/werkzeug/datastructures.py webnest(Download)
the `length` parameter of
:func:`shutil.copyfileobj`.
"""
from shutil import copyfileobj
close_dst = False
if isinstance(dst, basestring):
dst = file(dst, 'wb')
close_dst = True
try:
copyfileobj(self.stream, dst, buffer_size)
src/u/l/Uliweb-0.0.1a2/uliweb/lib/werkzeug/utils.py Uliweb(Download)
the `length` parameter of
:func:`shutil.copyfileobj`.
"""
from shutil import copyfileobj
close_dst = False
if isinstance(dst, basestring):
dst = file(dst, 'wb')
close_dst = True
try:
copyfileobj(self.stream, dst, buffer_size)
src/s/c/scrapy-HEAD/scrapyd/eggstorage.py scrapy(Download)
from __future__ import with_statement from glob import glob from os import path, makedirs, remove from shutil import copyfileobj, rmtree from distutils.version import LooseVersion
def put(self, eggfile, project, version):
eggpath = self._eggpath(project, version)
eggdir = path.dirname(eggpath)
if not path.exists(eggdir):
makedirs(eggdir)
with open(eggpath, 'wb') as f:
copyfileobj(eggfile, f)
src/a/p/AppStruct-HEAD/Python/AppStruct/WSGI/werkzeug.py AppStruct(Download)
the `length` parameter of
:func:`shutil.copyfileobj`.
"""
from shutil import copyfileobj
close_dst = False
if isinstance(dst, str):
dst = open(dst, 'wb')
close_dst = True
try:
copyfileobj(self.stream, dst, buffer_size)
src/p/y/pythonedinburgh-HEAD/werkzeug/datastructures.py pythonedinburgh(Download)
the `length` parameter of
:func:`shutil.copyfileobj`.
"""
from shutil import copyfileobj
close_dst = False
if isinstance(dst, basestring):
dst = file(dst, 'wb')
close_dst = True
try:
copyfileobj(self.stream, dst, buffer_size)
src/s/c/Scrapy-0.10.3/scrapyd/eggstorage.py Scrapy(Download)
from __future__ import with_statement from glob import glob from os import path, makedirs, remove from shutil import copyfileobj, rmtree from distutils.version import LooseVersion
def put(self, eggfile, project, version):
eggpath = self._eggpath(project, version)
eggdir = path.dirname(eggpath)
if not path.exists(eggdir):
makedirs(eggdir)
with open(eggpath, 'wb') as f:
copyfileobj(eggfile, f)
src/w/e/Werkzeug-0.6.2/werkzeug/datastructures.py Werkzeug(Download)
the `length` parameter of
:func:`shutil.copyfileobj`.
"""
from shutil import copyfileobj
close_dst = False
if isinstance(dst, basestring):
dst = file(dst, 'wb')
close_dst = True
try:
copyfileobj(self.stream, dst, buffer_size)
src/s/c/scrapy-HEAD/scrapy/contrib/feedexport.py scrapy(Download)
from datetime import datetime from urlparse import urlparse from ftplib import FTP from shutil import copyfileobj from zope.interface import Interface, implements
def store(self, file, spider):
copyfileobj(file, self._stdout)
class FileFeedStorage(BlockingFeedStorage):
def __init__(self, uri):
def _store_in_thread(self, file, spider):
dirname = os.path.dirname(self.path)
if dirname and not os.path.exists(dirname):
os.makedirs(dirname)
f = open(self.path, 'wb')
copyfileobj(file, f)
f.close()
1 | 2 | 3 | 4 Next