Commits

Anonymous committed 8ddb55f Draft

Fix easy_install woes, and wrap spawn_server thread.

  • Participants
  • Parent commits 538c6ad
  • Branches default
  • Tags version-1.3.0

Comments (0)

Files changed (5)

 Contact: Nir Aides
 Email:   nir@winpdb.org
 Website: http://www.winpdb.org/
-Version: 1.2.8
+Version: 1.3.0
 
 rfoo (remote foo) is a fast Python RPC package which can do 160,000 RPC 
 calls per second on a regular PC. It includes a fast serialization module 
 
 
 
-__version__ = '1.2.8'
+__version__ = '1.3.0'
 
 
 
 try:
     from rfoo.marsh import dumps, loads
 except ImportError:
-    sys.stderr.write("""To use rfoo directly from source archive first build
-the Cython extension module rfoo.marsh inplace with:
-    python setup.py build_ext --inplace\n""")
+    sys.stderr.write("""
+===========================================================    
+Did you just try to import rfoo directly from its source distribution?
+Well, that's possible, but first you need to build the 
+Cython extension rfoo.marsh (inplace) with:
+    python setup.py build_ext --inplace
+===========================================================\n""")
     raise
 
 try:

rfoo/utils/rconsole.py

 import logging
 import pprint
 import codeop
+import socket
 import code
 import rfoo
 import sys
         namespace = sys._getframe(1).f_globals
     
     server = rfoo.InetServer(ConsoleHandler, namespace)
-    thread.start_new_thread(server.start, (rfoo.LOOPBACK, port))
+
+    def _wrapper():
+        try:
+            server.start(rfoo.LOOPBACK, port)
+        except socket.error:
+            logging.warning('Failed to bind rconsole to socket port, port=%r.', port)
+
+    thread.start_new_thread(_wrapper, ())
 
 
 def interact(banner=None, readfunc=None, port=PORT):
 """
 
 
+import sys
 
 from distutils.core import setup
 from distutils.extension import Extension
 try:
     from Cython.Distutils import build_ext
 except ImportError:
-    import sys
-    sys.stderr.write("""rfoo depends on Cython - http://cython.org/
+    sys.stderr.write("""===========================================================
+rfoo depends on Cython - http://cython.org/
 
 To install Cython follow the simple instructions at:
 http://docs.cython.org/src/quickstart/install.html
     sudo apt-get install build-essential
 
 and then setup the latest source version of Cython with:
-    sudo python setup.py install\n""")
+    sudo python setup.py install
+===========================================================\n""")
+    sys.exit(1)
+
+
+if 'bdist_egg' in sys.argv:
+    sys.stderr.write("""===========================================================
+rfoo can not be installed by easy_install due to conflict 
+between easy_install and Cython:
+http://mail.python.org/pipermail/distutils-sig/2007-September/008205.html
+
+To install rfoo, download the source archive, extract it
+and install with:
+    sudo python setup.py install
+===========================================================\n""")
     sys.exit(1)
 
 
 
 setup(
     name = 'rfoo',
-    version = '1.2.8',
+    version = '1.3.0',
     description = 'Fast RPC client/server module.',
     author = 'Nir Aides',
     author_email = 'nir@winpdb.org',