summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2012-01-12 20:38:31 +0000
committerGiampaolo Rodola <g.rodola@gmail.com>2012-01-12 20:38:31 +0000
commitfb3a964109eb3a90eea1ed8b84c0ee870b59e0bd (patch)
treecf870a852dcd46b446978ba2088b39a6bf2a2070 /README
parent7f007410b0029044ff67082cc8d8bcefa0412050 (diff)
downloadpysendfile-fb3a964109eb3a90eea1ed8b84c0ee870b59e0bd.tar.gz
use RestructuredText for README so that pypi page looks nice
Diffstat (limited to 'README')
-rw-r--r--README73
1 files changed, 30 insertions, 43 deletions
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