summaryrefslogtreecommitdiff
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
parent7f007410b0029044ff67082cc8d8bcefa0412050 (diff)
downloadpysendfile-fb3a964109eb3a90eea1ed8b84c0ee870b59e0bd.tar.gz
use RestructuredText for README so that pypi page looks nice
-rw-r--r--HISTORY2
-rw-r--r--README73
-rw-r--r--setup.py6
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'],