403Webshell
Server IP : 216.107.138.43  /  Your IP : 216.73.217.127
Web Server : LiteSpeed
System : Linux srv514655384.host.ultaserver.net 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64
User : ojolc3829 ( 1151)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/twisted/test/stdio_test_lastwrite.py
# -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTests.test_lastWriteReceived -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_lastWriteReceived}
to test that L{os.write} can be reliably used after
L{twisted.internet.stdio.StandardIO} has finished.
"""


import sys

from twisted.internet.protocol import Protocol
from twisted.internet.stdio import StandardIO
from twisted.python.reflect import namedAny


class LastWriteChild(Protocol):
    def __init__(self, reactor, magicString):
        self.reactor = reactor
        self.magicString = magicString

    def connectionMade(self):
        self.transport.write(self.magicString)
        self.transport.loseConnection()

    def connectionLost(self, reason):
        self.reactor.stop()


def main(reactor, magicString):
    p = LastWriteChild(reactor, magicString.encode("ascii"))
    StandardIO(p)
    reactor.run()


if __name__ == "__main__":
    namedAny(sys.argv[1]).install()
    from twisted.internet import reactor

    main(reactor, sys.argv[2])

Youez - 2016 - github.com/yon3zu
LinuXploit