@@ -0,0 +1,1806 @@
+#!/usr/bin/python%0Aimport getpass%0Aimport sys%0Aimport telnetlib%0A%0ADEBUG = True%0A%0Aclass rpc3:%0A    def __init__(self,host,login=None, passwd=None):%0A        print (%22Initializing%22)%0A        self.host = host%0A        self.login = login%0A        self.passwd = passwd%0A        self.status = %22offline%22%0A        # 8 outlets%0A        self.outlets = ();%0A        %0A    def connect(self):%0A        print (%22Making connection to %22 + self.host)%0A        if (DEBUG is True):%0A            if (self.login is not None ):%0A                if (self.passwd is not None):%0A                    print (%22as %22 + self.login +  %22/%22 + self.passwd)%0A                else:%0A                    print (%22as %22 + self.login)%0A        # use telnetlib%0A        self.conn = telnetlib.Telnet(self.host)%0A#        conn.read_until(%22login: %22)%0A#        if (self.login is not False):%0A#            conn.write(self.login = %22%5Cn%22)%0A#        print (self.conn.read_until(%22for a list of commands%22))%0A%0A    def disconnect(self):%0A        if self.status == %22online%22:%0A            self.conn.write(%22Logoff%5Cn%22)%0A            self.status = %22offline%22%0A%0A    def getStatus(self):%0A        isPrompt = False%0A        while isPrompt is False:%0A            # remove %5Cn%5Cr at the end.%0A            # rstrip(%22%5Cn%5Cr%22) leave some empty at the end%0A            # rstrip() seems work better by treating all as whitespaces%0A            line = self.conn.read_until('%5Cn').rstrip()%0A            if DEBUG is True:%0A                print (%22  read:%3C%22 + line + %22%3E%22)%0A            if %22for a list of commands%22 in line:%0A                print (%22Done%22)%0A                isPrompt = True%0A            elif %22)..%22%0A    %0A%0A# main%0Amyrpc1 = rpc3 (%22192.168.10.150%22)%0Amyrpc1.connect()%0Amyrpc1.getStatus()%0Amyrpc1.disconnect()%0A#myrpc2 = rpc3 (%22192.168.100.150%22,%22mng%22)%0A#myrpc2.connect()%0A#myrpc3 = rpc3 (%22192.168.100.150%22,%22ngm%22,%22ok%22)%0A#myrpc3.connect()%0A

add a test version of code (can talk to RPC-5)