Beispiel #1
0
	def requestWrite(self, notused1=None, notused2=None):
		converter_args = []
		self.converter = Streaming(converter_args)
		self.converter.source = self
		if PY3:
			self.request.write(self.converter.getText().encode(encoding='utf-8', errors='strict'))
		else:
			self.request.write(self.converter.getText())
 def requestWrite(self, notused1=None, notused2=None):
     converter_args = []
     self.converter = Streaming(converter_args)
     if self.converter:
         self.converter.source = self
         try:
             self.request.write(self.converter.getText())
         except:
             return
Beispiel #3
0
class StreamAdapter:
    EV_BEGIN = 0
    EV_STOP = 1

    def __init__(self, session, request):
        self.nav = session.nav
        self.request = request
        self.mystream = StreamService(self.nav)
        if PY3:
            self.mystream.handleCommand(
                request.args[b"StreamService"][0].decode(encoding='utf-8',
                                                         errors='strict'))
        else:
            self.mystream.handleCommand(request.args["StreamService"][0])
        self.mystream.execBegin()
        self.service = self.mystream.getService()
        self.nav.record_event.append(self.requestWrite)
        request.notifyFinish().addCallback(self.close, None)
        request.notifyFinish().addErrback(self.close, None)
        self.mystream.clientIP = request.getAllHeaders().get(
            'x-forwarded-for', request.getClientIP())
        self.mystream.streamIndex = len(streamList) - 1
        self.mystream.request = request
        streamList.append(self.mystream)
        self.setStatus(StreamAdapter.EV_BEGIN)

    def setStatus(self, state):
        for x in streamStates:
            x(state, self.mystream)

    def close(self, nothandled1=None, nothandled2=None):
        self.mystream.execEnd()
        self.nav.record_event.remove(self.requestWrite)
        self.converter = None
        if self.mystream in streamList:
            streamList.remove(self.mystream)
        self.setStatus(StreamAdapter.EV_STOP)

    def requestWrite(self, notused1=None, notused2=None):
        converter_args = []
        self.converter = Streaming(converter_args)
        self.converter.source = self
        if PY3:
            self.request.write(self.converter.getText().encode(
                encoding='utf-8', errors='strict'))
        else:
            self.request.write(self.converter.getText())
class StreamAdapter:
    def __init__(self, session, request):
        self.nav = session.nav
        self.request = request
        self.mystream = StreamService(self.nav)
        self.mystream.handleCommand(request.args["StreamService"][0])
        self.mystream.execBegin()
        self.service = self.mystream.getService()
        self.nav.record_event.append(self.requestWrite)
        request.notifyFinish().addCallback(self.close, None)
        request.notifyFinish().addErrback(self.close, None)

    def close(self, nothandled1=None, nothandled2=None):
        self.mystream.execEnd()
        self.nav.record_event.remove(self.requestWrite)
        self.converter = None

    def requestWrite(self, notused1=None, notused2=None):
        converter_args = []
        self.converter = Streaming(converter_args)
        self.converter.source = self
        self.request.write(self.converter.getText())
class StreamAdapter:
	def __init__(self, session, request):
		self.nav = session.nav
		self.request = request
		self.mystream = StreamService(self.nav)
		self.mystream.handleCommand(request.args["StreamService"][0])
		self.mystream.execBegin()
		self.service = self.mystream.getService()
		self.nav.record_event.append(self.requestWrite)
		request.notifyFinish().addCallback(self.close, None)
		request.notifyFinish().addErrback(self.close, None)

	def close(self, nothandled1 = None, nothandled2 = None):
		self.mystream.execEnd()
		self.nav.record_event.remove(self.requestWrite)
		self.converter = None

	def requestWrite(self, notused1 = None, notused2 = None):
		converter_args = []
		self.converter = Streaming(converter_args)
		self.converter.source = self
		self.request.write(self.converter.getText())
Beispiel #6
0
class StreamAdapter:
	EV_BEGIN = 0
	EV_STOP = 1

	def __init__(self, session, request):
		self.nav = session.nav
		self.request = request
		self.mystream = StreamService(self.nav)
		self.mystream.handleCommand(request.args["StreamService"][0])
		self.mystream.execBegin()
		self.service = self.mystream.getService()
		self.nav.record_event.append(self.requestWrite)
		request.notifyFinish().addCallback(self.close, None)
		request.notifyFinish().addErrback(self.close, None)
		self.mystream.clientIP = request.getAllHeaders().get('x-forwarded-for', request.getClientIP())
		self.mystream.streamIndex = len(streamList) - 1
		self.mystream.request = request
		streamList.append(self.mystream)
		self.setStatus(StreamAdapter.EV_BEGIN)

	def setStatus(self, state):
		for x in streamStates:
			x(state, self.mystream)

	def close(self, nothandled1 = None, nothandled2 = None):
		self.mystream.execEnd()
		self.nav.record_event.remove(self.requestWrite)
		self.converter = None
		if self.mystream in streamList:
			streamList.remove(self.mystream)
		self.setStatus(StreamAdapter.EV_STOP)

	def requestWrite(self, notused1 = None, notused2 = None):
		converter_args = []
		self.converter = Streaming(converter_args)
		self.converter.source = self
		self.request.write(self.converter.getText())
 def requestWrite(self, notused1=None, notused2=None):
     converter_args = []
     self.converter = Streaming(converter_args)
     self.converter.source = self
     self.request.write(self.converter.getText())
	def requestWrite(self, notused1 = None, notused2 = None):
		converter_args = []
		self.converter = Streaming(converter_args)
		self.converter.source = self
		self.request.write(self.converter.getText())