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
-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'
     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 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 build_ext --inplace


 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
     from Cython.Distutils import build_ext
 except ImportError:
-    import sys
-    sys.stderr.write("""rfoo depends on Cython -
+    sys.stderr.write("""===========================================================
+rfoo depends on Cython -
 To install Cython follow the simple instructions at:
     sudo apt-get install build-essential
 and then setup the latest source version of Cython with:
-    sudo python install\n""")
+    sudo python install
+    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:
+To install rfoo, download the source archive, extract it
+and install with:
+    sudo python install
     name = 'rfoo',
-    version = '1.2.8',
+    version = '1.3.0',
     description = 'Fast RPC client/server module.',
     author = 'Nir Aides',
     author_email = '',