From fb3a964109eb3a90eea1ed8b84c0ee870b59e0bd Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Thu, 12 Jan 2012 20:38:31 +0000 Subject: use RestructuredText for README so that pypi page looks nice --- HISTORY | 2 +- README | 73 ++++++++++++++++++++++++++-------------------------------------- setup.py | 6 +++--- 3 files changed, 34 insertions(+), 47 deletions(-) diff --git a/HISTORY b/HISTORY index 698628c..56f0529 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,6 @@ Bug tracker at http://code.google.com/p/py-sendfile/issues/list -Version 2.0.0 - XXXX-XX-XX +Version 2.0.0 - 2012-01-12 ========================== (Giampaolo RodolĂ  took over maintenance) diff --git a/README b/README index 927318c..920cb3a 100644 --- a/README +++ b/README @@ -1,9 +1,15 @@ +=========== +Quick links +=========== + +* Home page: http://code.google.com/p/pysendfile +* Download: http://code.google.com/p/pysendfile/downloads/list + ===== About ===== -A python interface to sendfile(2) system call: -http://code.google.com/p/pysendfile/ +A python interface to sendfile(2) system call. ======= Install @@ -32,44 +38,25 @@ Python versions from 2.5 to 3.3 by using a single code base. Example usage ============= -import socket -import errno -from sendfile import sendfile - -file = open("somefile", "rb") -sock = socket.socket() -sock.connect(("127.0.0.1", 8021)) -offset = 0 - -while 1: - try: - sent = sendfile(sock.fileno(), file.fileno(), offset, 4096) - except OSError, err: - if err.errno == (errno.EAGAIN, errno.EBUSY): # retry - continue - raise - else: - if sent == 0: - break # done - offset += sent - -======= -Authors -======= - -pysendfile was originally written by Ben Woolley including Linux , FreeBSD -and DragonflyBSD support. - -Later on Niklas Edmundsson took over maintenance and added AIX support. - -It's been completely rewritten by Giampaolo Rodola' (g.rodola@gmail.com) who -took over maintenance and added support for: - - * Python 3 - * non-blocking sockets - * large files support - * Mac OSX - * Sun OS - * FreeBSD flag argument - * a simple benchmark suite - * unit tests +:: + + import socket + import errno + from sendfile import sendfile + + file = open("somefile", "rb") + sock = socket.socket() + sock.connect(("127.0.0.1", 8021)) + offset = 0 + + while 1: + try: + sent = sendfile(sock.fileno(), file.fileno(), offset, 4096) + except OSError, err: + if err.errno == (errno.EAGAIN, errno.EBUSY): # retry + continue + raise + else: + if sent == 0: + break # done + offset += sent diff --git a/setup.py b/setup.py index 2ff011d..b29c3fc 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,8 @@ def main(): author='Giampaolo Rodola', author_email='g.rodola@gmail.com', download_url=download_url, - license='License :: OSI Approved :: MIT License', + platforms='UNIX', + license='MIT', keywords=['sendfile', 'python', 'performance', 'ftp'], classifiers = [ 'Development Status :: 5 - Production/Stable', @@ -72,12 +73,11 @@ def main(): 'Programming Language :: Python :: 3.0', 'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Topic :: System :: Networking', 'Topic :: System :: Operating System', 'Topic :: Internet :: File Transfer Protocol (FTP)', 'Topic :: Internet :: WWW/HTTP', - 'License :: OSI Approved :: GNU Library or Lesser General ', + 'License :: OSI Approved :: MIT License', ], ext_modules = [Extension('sendfile', sources=['sendfilemodule.c'], -- cgit v1.2.1