����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 216.73.216.19
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/thread-self/root/usr/lib/python3/dist-packages/twisted/conch/insults/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/usr/lib/python3/dist-packages/twisted/conch/insults/client.py
"""
You don't really want to use this module. Try insults.py instead.
"""

from __future__ import print_function

from twisted.internet import protocol

class InsultsClient(protocol.Protocol):

    escapeTimeout = 0.2

    def __init__(self):
        self.width = self.height = None
        self.xpos = self.ypos = 0
        self.commandQueue = []
        self.inEscape = ''

    def setSize(self, width, height):
        call = 0
        if self.width:
            call = 1
        self.width = width
        self.height = height
        if call:
            self.windowSizeChanged()

    def dataReceived(self, data):
        from twisted.internet import reactor
        for ch in data:
            if ch == '\x1b':
                if self.inEscape:
                    self.keyReceived(ch)
                    self.inEscape = ''
                else:
                    self.inEscape = ch
                    self.escapeCall = reactor.callLater(self.escapeTimeout,
                                                        self.endEscape)
            elif ch in 'ABCD' and self.inEscape:
                self.inEscape = ''
                self.escapeCall.cancel()
                if ch == 'A':
                    self.keyReceived('<Up>')
                elif ch == 'B':
                    self.keyReceived('<Down>')
                elif ch == 'C':
                    self.keyReceived('<Right>')
                elif ch == 'D':
                    self.keyReceived('<Left>')
            elif self.inEscape:
                self.inEscape += ch
            else:
                self.keyReceived(ch)

    def endEscape(self):
        ch = self.inEscape
        self.inEscape = ''
        self.keyReceived(ch)

    def initScreen(self):
        self.transport.write('\x1b=\x1b[?1h')

    def gotoXY(self, x, y):
        """Go to a position on the screen.
        """
        self.xpos = x
        self.ypos = y
        self.commandQueue.append(('gotoxy', x, y))

    def writeCh(self, ch):
        """Write a character to the screen.  If we're at the end of the row,
        ignore the write.
        """
        if self.xpos < self.width - 1:
            self.commandQueue.append(('write', ch))
            self.xpos += 1

    def writeStr(self, s):
        """Write a string to the screen.  This does not wrap a the edge of the
        screen, and stops at \\r and \\n.
        """
        s = s[:self.width-self.xpos]
        if '\n' in s:
            s=s[:s.find('\n')]
        if '\r' in s:
            s=s[:s.find('\r')]
        self.commandQueue.append(('write', s))
        self.xpos += len(s)

    def eraseToLine(self):
        """Erase from the current position to the end of the line.
        """
        self.commandQueue.append(('eraseeol',))

    def eraseToScreen(self):
        """Erase from the current position to the end of the screen.
        """
        self.commandQueue.append(('eraseeos',))
    
    def clearScreen(self):
        """Clear the screen, and return the cursor to 0, 0.
        """
        self.commandQueue = [('cls',)]
        self.xpos = self.ypos = 0

    def setAttributes(self, *attrs):
        """Set the attributes for drawing on the screen.
        """
        self.commandQueue.append(('attributes', attrs))

    def refresh(self):
        """Redraw the screen.
        """
        redraw = ''
        for command in self.commandQueue:
            if command[0] == 'gotoxy':
                redraw += '\x1b[%i;%iH' % (command[2]+1, command[1]+1)
            elif command[0] == 'write':
                redraw += command[1]
            elif command[0] == 'eraseeol':
                redraw += '\x1b[0K'
            elif command[0] == 'eraseeos':
                redraw += '\x1b[OJ'
            elif command[0] == 'cls':
                redraw += '\x1b[H\x1b[J'
            elif command[0] == 'attributes':
                redraw += '\x1b[%sm' % ';'.join(map(str, command[1]))
            else:
                print(command)
        self.commandQueue = []
        self.transport.write(redraw)

    def windowSizeChanged(self):
        """Called when the size of the window changes.
        Might want to redraw the screen here, or something.
        """

    def keyReceived(self, key):
        """Called when the user hits a key.
        """

Youez - 2016 - github.com/yon3zu
LinuXploit