[svn r40705] move greenlet support objects to the "py/green" directory.

--HG--
branch : trunk
This commit is contained in:
hpk 2007-03-18 17:28:04 +01:00
parent 5506b03f81
commit 9515dafb1c
15 changed files with 14 additions and 14 deletions

View File

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

View File

@ -1,4 +1,4 @@
from py.__.net import greensock2 from py.__.green import greensock2
VERBOSE = True VERBOSE = True

View File

@ -1,5 +1,5 @@
import os import os
from py.__.net import greensock2 from py.__.green import greensock2
class FDInput(object): class FDInput(object):

View File

@ -1,4 +1,4 @@
from py.__.net import greensock2 from py.__.green import greensock2
import socket, errno, os import socket, errno, os
error = socket.error error = socket.error

View File

@ -1,4 +1,4 @@
from py.__.net.pipe.common import BufferedInput from py.__.green.pipe.common import BufferedInput
class MeetingPointInput(BufferedInput): class MeetingPointInput(BufferedInput):

View File

@ -1,6 +1,6 @@
import BaseHTTPServer import BaseHTTPServer
from py.__.net import greensock2 from py.__.green import greensock2
from py.__.net.pipe.gsocket import GreenSocket from py.__.green.pipe.gsocket import GreenSocket
class GreenMixIn: class GreenMixIn:

View File

@ -1,5 +1,5 @@
import py import py
from py.__.net.greenexecnet import * from py.__.green.greenexecnet import *
def test_simple(): def test_simple():
gw = PopenGateway() gw = PopenGateway()

View File

@ -1,6 +1,6 @@
import py import py
from socket import * from socket import *
from py.__.net.greensock2 import * from py.__.green.greensock2 import *
def test_meetingpoint(): def test_meetingpoint():
giv1, acc1 = meetingpoint() giv1, acc1 = meetingpoint()

View File

@ -1,5 +1,5 @@
import os, random import os, random
from py.__.net.pipelayer import PipeLayer, pipe_over_udp, PipeOverUdp from py.__.green.pipelayer import PipeLayer, pipe_over_udp, PipeOverUdp
def test_simple(): def test_simple():
data1 = os.urandom(1000) data1 = os.urandom(1000)