don't call terminal functions directly

This commit is contained in:
Michel Oosterhof
2015-12-08 12:04:35 +04:00
parent e7db369805
commit 7324bc4c7b
3 changed files with 14 additions and 17 deletions

View File

@@ -234,8 +234,6 @@ class HTTPProgressDownloader(client.HTTPDownloader):
(self.curl.url,))
self.fileName = os.path.devnull
self.nomore = True
#self.curl.writeln('Saving to: `%s' % self.fakeoutfile)
#self.curl.protocol.terminal.nextLine()
if self.fakeoutfile:
self.curl.writeln(' % Total % Received % Xferd Average Speed Time Time Time Current')
@@ -293,10 +291,9 @@ class HTTPProgressDownloader(client.HTTPDownloader):
# self.fakeoutfile, self.currentlength, self.totallength))
if self.fakeoutfile:
self.curl.write("\r100 %d 100 %d 0 0 %d 0 --:--:-- --:--:-- --:--:-- %d" % \
self.curl.writeln("\r100 %d 100 %d 0 0 %d 0 --:--:-- --:--:-- --:--:-- %d" % \
(self.currentlength, self.currentlength , 63673, 65181)
)
self.curl.protocol.terminal.nextLine()
self.curl.fs.mkfile(self.fakeoutfile, 0, 0, self.totallength, 33188)
self.curl.fs.update_realfile(

View File

@@ -46,16 +46,16 @@ class command_scp(HoneyPotCommand):
self.help()
self.exit()
return
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.protocol.terminal.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
self.write( '\x00' )
def lineReceived(self, line):
log.msg( eventid='KIPP0008', realm='scp', input=line,

View File

@@ -243,7 +243,7 @@ class HTTPProgressDownloader(client.HTTPDownloader):
self.nomore = True
if self.quiet == False:
self.wget.writeln('Saving to: `%s' % self.fakeoutfile)
self.wget.protocol.terminal.nextLine()
self.wget.nextLine()
return client.HTTPDownloader.gotHeaders(self, headers)
@@ -290,8 +290,8 @@ class HTTPProgressDownloader(client.HTTPDownloader):
('%s>' % (38 * '='),
splitthousands(str(int(self.totallength))).ljust(12),
self.speed / 1000))
self.wget.protocol.terminal.nextLine()
self.wget.protocol.terminal.nextLine()
self.wget.nextLine()
self.wget.nextLine()
self.wget.writeln(
'%s (%d KB/s) - `%s\' saved [%d/%d]' % \
(time.strftime('%Y-%m-%d %H:%M:%S'),