80 |
|
|
81 |
def connect(self, username, password): |
def connect(self, username, password): |
82 |
try: |
try: |
83 |
self.hostkey = None |
#self.hostkey = None |
84 |
self.transport.connect(username=username, |
self.transport.connect(username=username, |
85 |
password=password, |
password=password, |
86 |
hostkey=self.hostkey) |
hostkey=self.hostkey) |
171 |
# increment the following number if only one Ctrl-K |
# increment the following number if only one Ctrl-K |
172 |
# interferes with another application |
# interferes with another application |
173 |
if CK >= 1: |
if CK >= 1: |
174 |
self.reset_term() |
self.reset_term() |
175 |
self.fdout.write("\n") |
self.fdout.write("\n") |
176 |
self.cmd.cmdloop() |
self.cmd.cmdloop() |
177 |
fcntl.fcntl(self.fdin, fcntl.F_SETFL, os.O_NDELAY) |
fcntl.fcntl(self.fdin, fcntl.F_SETFL, os.O_NDELAY) |
178 |
self.set_term() |
self.set_term() |
179 |
# send ^L to clear screen and restore cmd line |
# send ^L to clear screen and restore cmd line |
180 |
self.session.send(chr(12)) |
self.session.send(chr(12)) |
181 |
CK = 0 |
CK = 0 |
182 |
continue |
continue |
183 |
|
|
184 |
self.session.send(x) |
self.session.send(x) |