[py-svn] r57756 - in py/trunk: contrib contrib/pygreen contrib/pygreen/pipe contrib/pygreen/test py/green

hpk at codespeak.net hpk at codespeak.net
Tue Sep 2 14:42:37 CEST 2008


Author: hpk
Date: Tue Sep  2 14:42:35 2008
New Revision: 57756

Added:
   py/trunk/contrib/
   py/trunk/contrib/pygreen/
      - copied from r57745, py/trunk/py/green/
   py/trunk/contrib/pygreen/conftest.py
      - copied, changed from r57754, py/trunk/py/green/conftest.py
   py/trunk/contrib/readme.txt   (contents, props changed)
Removed:
   py/trunk/py/green/
Modified:
   py/trunk/contrib/pygreen/greenexecnet.py
   py/trunk/contrib/pygreen/pipe/common.py
   py/trunk/contrib/pygreen/pipe/fd.py
   py/trunk/contrib/pygreen/pipe/gsocket.py
   py/trunk/contrib/pygreen/pipe/mp.py
   py/trunk/contrib/pygreen/test/test_greenexecnet.py
   py/trunk/contrib/pygreen/test/test_greensock2.py
   py/trunk/contrib/pygreen/test/test_pipelayer.py
Log:
* create new contrib directory
* move py/green to contrib/pygreen, 
  fix tests and code to pass


Copied: py/trunk/contrib/pygreen/conftest.py (from r57754, py/trunk/py/green/conftest.py)
==============================================================================
--- py/trunk/py/green/conftest.py	(original)
+++ py/trunk/contrib/pygreen/conftest.py	Tue Sep  2 14:42:35 2008
@@ -5,4 +5,4 @@
         if os.name == 'nt':
             py.test.skip("Cannot test green layer on windows")
         else:
-            return super(Directory, self).run()
+            return super(Directory, self).collect()

Modified: py/trunk/contrib/pygreen/greenexecnet.py
==============================================================================
--- py/trunk/py/green/greenexecnet.py	(original)
+++ py/trunk/contrib/pygreen/greenexecnet.py	Tue Sep  2 14:42:35 2008
@@ -13,8 +13,8 @@
 """
 
 import sys, os, py, inspect
-from py.__.green import greensock2
-from py.__.green.msgstruct import message, decodemessage
+from pygreen import greensock2
+from pygreen.msgstruct import message, decodemessage
 
 MSG_REMOTE_EXEC = 'r'
 MSG_OBJECT      = 'o'
@@ -163,7 +163,7 @@
     action = "exec input()"
 
     def __init__(self, cmdline):
-        from py.__.green.pipe.fd import FDInput, FDOutput
+        from pygreen.pipe.fd import FDInput, FDOutput
         child_in, child_out = os.popen2(cmdline, 't', 0)
         fdin  = FDInput(child_out.fileno(), child_out.close)
         fdout = FDOutput(child_in.fileno(), child_in.close)
@@ -173,14 +173,14 @@
     def get_bootstrap_code():
         # XXX assumes that the py lib is installed on the remote side
         src = []
-        src.append('from py.__.green import greenexecnet')
+        src.append('from pygreen import greenexecnet')
         src.append('greenexecnet.PopenCmdGateway.run_server()')
         src.append('')
         return '%r\n' % ('\n'.join(src),)
     get_bootstrap_code = staticmethod(get_bootstrap_code)
 
     def run_server():
-        from py.__.green.pipe.fd import FDInput, FDOutput
+        from pygreen.pipe.fd import FDInput, FDOutput
         gw = Gateway(input = FDInput(os.dup(0)),
                      output = FDOutput(os.dup(1)),
                      is_remote = True)

Modified: py/trunk/contrib/pygreen/pipe/common.py
==============================================================================
--- py/trunk/py/green/pipe/common.py	(original)
+++ py/trunk/contrib/pygreen/pipe/common.py	Tue Sep  2 14:42:35 2008
@@ -1,4 +1,4 @@
-from py.__.green import greensock2
+from pygreen import greensock2
 
 VERBOSE = True
 

Modified: py/trunk/contrib/pygreen/pipe/fd.py
==============================================================================
--- py/trunk/py/green/pipe/fd.py	(original)
+++ py/trunk/contrib/pygreen/pipe/fd.py	Tue Sep  2 14:42:35 2008
@@ -1,5 +1,5 @@
 import os
-from py.__.green import greensock2
+from pygreen import greensock2
 
 
 class FDInput(object):

Modified: py/trunk/contrib/pygreen/pipe/gsocket.py
==============================================================================
--- py/trunk/py/green/pipe/gsocket.py	(original)
+++ py/trunk/contrib/pygreen/pipe/gsocket.py	Tue Sep  2 14:42:35 2008
@@ -1,4 +1,4 @@
-from py.__.green import greensock2
+from pygreen import greensock2
 import socket, errno, os
 
 error = socket.error

Modified: py/trunk/contrib/pygreen/pipe/mp.py
==============================================================================
--- py/trunk/py/green/pipe/mp.py	(original)
+++ py/trunk/contrib/pygreen/pipe/mp.py	Tue Sep  2 14:42:35 2008
@@ -1,4 +1,4 @@
-from py.__.green.pipe.common import BufferedInput
+from pygreen.pipe.common import BufferedInput
 
 
 class MeetingPointInput(BufferedInput):

Modified: py/trunk/contrib/pygreen/test/test_greenexecnet.py
==============================================================================
--- py/trunk/py/green/test/test_greenexecnet.py	(original)
+++ py/trunk/contrib/pygreen/test/test_greenexecnet.py	Tue Sep  2 14:42:35 2008
@@ -1,7 +1,12 @@
 import py
-from py.__.green.greenexecnet import *
+from pygreen.greenexecnet import *
+import pygreen
 
-py.test.skip("Does not work with globally installed pylib")
+def setup_module(mod):
+    os.environ["PYTHONPATH"] = "%s:%s" %(
+            py.path.local(pygreen.__file__).dirpath().dirpath(), os.environ['PYTHONPATH'])
+    #py.test.skip("need to fix PYTHONPATH/sys.path handling for sub processes so "
+    #             "that they find the pygreen package.")
 
 def test_simple():
     gw = PopenGateway()

Modified: py/trunk/contrib/pygreen/test/test_greensock2.py
==============================================================================
--- py/trunk/py/green/test/test_greensock2.py	(original)
+++ py/trunk/contrib/pygreen/test/test_greensock2.py	Tue Sep  2 14:42:35 2008
@@ -1,6 +1,6 @@
 import py
 from socket import *
-from py.__.green.greensock2 import *
+from pygreen.greensock2 import *
 
 def test_meetingpoint():
     giv1, acc1 = meetingpoint()

Modified: py/trunk/contrib/pygreen/test/test_pipelayer.py
==============================================================================
--- py/trunk/py/green/test/test_pipelayer.py	(original)
+++ py/trunk/contrib/pygreen/test/test_pipelayer.py	Tue Sep  2 14:42:35 2008
@@ -1,5 +1,5 @@
 import os, random
-from py.__.green.pipelayer import PipeLayer, pipe_over_udp, PipeOverUdp
+from pygreen.pipelayer import PipeLayer, pipe_over_udp, PipeOverUdp
 
 def test_simple():
     data1 = os.urandom(1000)

Added: py/trunk/contrib/readme.txt
==============================================================================
--- (empty file)
+++ py/trunk/contrib/readme.txt	Tue Sep  2 14:42:35 2008
@@ -0,0 +1,2 @@
+
+pygreen: experimental IO and execnet operations through greenlets 



More information about the pytest-commit mailing list