Remove commented out print statements.
This commit is contained in:
parent
402cbed8fa
commit
bc340fbf0d
35 changed files with 0 additions and 103 deletions
|
|
@ -110,7 +110,6 @@ class PortalSessionHandler(SessionHandler):
|
|||
|
||||
self.sessions[session.sessid] = session
|
||||
session.server_connected = True
|
||||
#print "connecting", session.sessid, " number:", len(self.sessions)
|
||||
self.portal.amp_protocol.send_AdminPortal2Server(session.sessid,
|
||||
operation=PCONN,
|
||||
sessiondata=sessdata)
|
||||
|
|
@ -389,7 +388,6 @@ class PortalSessionHandler(SessionHandler):
|
|||
# data throttle (anti DoS measure)
|
||||
now = time()
|
||||
dT = now - self.command_counter_reset
|
||||
#print " command rate:", _MAX_COMMAND_RATE / dT, dT, self.command_counter
|
||||
self.command_counter = 0
|
||||
self.command_counter_reset = now
|
||||
self.command_overflow = dT < 1.0
|
||||
|
|
@ -431,9 +429,7 @@ class PortalSessionHandler(SessionHandler):
|
|||
if session:
|
||||
# convert oob to the generic format
|
||||
if "oob" in kwargs:
|
||||
#print "oobstruct_parser in:", kwargs["oob"]
|
||||
kwargs["oob"] = self.oobstruct_parser(kwargs["oob"])
|
||||
#print "oobstruct_parser out:", kwargs["oob"]
|
||||
session.data_out(text=text, **kwargs)
|
||||
|
||||
PORTAL_SESSIONS = PortalSessionHandler()
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ def verify_SSL_key_and_cert(keyfile, certfile):
|
|||
# default:
|
||||
#openssl req -new -x509 -key ssl.key -out ssl.cert -days 7300
|
||||
exestring = "openssl req -new -x509 -key %s -out %s -days %s" % (keyfile, certfile, CERT_EXPIRE)
|
||||
#print "exestring:", exestring
|
||||
try:
|
||||
#, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
subprocess.call(exestring)
|
||||
|
|
|
|||
|
|
@ -165,7 +165,6 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
"""
|
||||
if data and data[0] == IAC or self.iaw_mode:
|
||||
try:
|
||||
#print "IAC mode"
|
||||
super(TelnetProtocol, self).dataReceived(data)
|
||||
if len(data) == 1:
|
||||
self.iaw_mode = True
|
||||
|
|
@ -196,12 +195,10 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
|
||||
# if we get to this point the command should end with a linebreak.
|
||||
# We make sure to add it, to fix some clients messing this up.
|
||||
#print "line data in:", repr(data)
|
||||
StatefulTelnetProtocol.dataReceived(self, data)
|
||||
|
||||
def _write(self, data):
|
||||
"hook overloading the one used in plain telnet"
|
||||
# print "_write (%s): %s" % (self.state, " ".join(str(ord(c)) for c in data))
|
||||
data = data.replace('\n', '\r\n').replace('\r\r\n', '\r\n')
|
||||
#data = data.replace('\n', '\r\n')
|
||||
super(TelnetProtocol, self)._write(mccp_compress(self, data))
|
||||
|
|
@ -214,7 +211,6 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
line (str): Line to send.
|
||||
|
||||
"""
|
||||
#print "sendLine (%s):\n%s" % (self.state, line)
|
||||
#escape IAC in line mode, and correctly add \r\n
|
||||
line += self.delimiter
|
||||
line = line.replace(IAC, IAC + IAC).replace('\n', '\r\n')
|
||||
|
|
@ -305,7 +301,6 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
if "oob" in kwargs and "OOB" in self.protocol_flags:
|
||||
# oob is a list of [(cmdname, arg, kwarg), ...]
|
||||
for cmdname, args, okwargs in kwargs["oob"]:
|
||||
#print "telnet oob data_out:", cmdname, args, kwargs
|
||||
self.oob.data_out(cmdname, *args, **okwargs)
|
||||
|
||||
# parse **kwargs, falling back to ttype if nothing is given explicitly
|
||||
|
|
@ -318,15 +313,12 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
echo = kwargs.get("echo", None)
|
||||
mxp = kwargs.get("mxp", self.protocol_flags.get("MXP", False))
|
||||
|
||||
#print "telnet kwargs=%s, message=%s" % (kwargs, text)
|
||||
#print "xterm256=%s, useansi=%s, raw=%s, nomarkup=%s, init_done=%s" % (xterm256, useansi, raw, nomarkup, ttype.get("init_done"))
|
||||
if raw:
|
||||
# no processing whatsoever
|
||||
self.sendLine(text)
|
||||
elif text:
|
||||
# we need to make sure to kill the color at the end in order
|
||||
# to match the webclient output.
|
||||
#print "telnet data out:", self.protocol_flags, id(self.protocol_flags), id(self), "nomarkup: %s, xterm256: %s" % (nomarkup, xterm256)
|
||||
linetosend = ansi.parse_ansi(_RE_N.sub("", text) + "{n", strip_ansi=nomarkup, xterm256=xterm256, mxp=mxp)
|
||||
if mxp:
|
||||
linetosend = mxp_parse(linetosend)
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ class TelnetOOB(object):
|
|||
else:
|
||||
msdp_string = "%s%s%s" % (MSDP_VAR. cmdname, "".join(
|
||||
["%s%s%s%s" % (MSDP_VAR, key, MSDP_VAL, val) for key, val in kwargs.items()]))
|
||||
#print "encode msdp result:", cmdname, args, kwargs, "->", msdp_string
|
||||
return force_str(msdp_string)
|
||||
|
||||
def encode_gmcp(self, cmdname, *args, **kwargs):
|
||||
|
|
@ -194,7 +193,6 @@ class TelnetOOB(object):
|
|||
gmcp_string = "%s %s" % (cmdname, json.dumps(args))
|
||||
elif kwargs:
|
||||
gmcp_string = "%s %s" % (cmdname, json.dumps(kwargs))
|
||||
#print "gmcp_encode", cmdname, args, kwargs, "->", gmcp_string
|
||||
return force_str(gmcp_string).strip()
|
||||
|
||||
def decode_msdp(self, data):
|
||||
|
|
@ -233,8 +231,6 @@ class TelnetOOB(object):
|
|||
parts = msdp_regex_val.split(varval)
|
||||
variables[parts[0]] = tuple(parts[1:]) if len(parts) > 1 else ("", )
|
||||
|
||||
#print "OOB: MSDP decode:", data, "->", variables, arrays, tables
|
||||
|
||||
# send to the sessionhandler
|
||||
if data:
|
||||
for varname, var in variables.items():
|
||||
|
|
@ -263,7 +259,6 @@ class TelnetOOB(object):
|
|||
if hasattr(data, "__iter__"):
|
||||
data = "".join(data)
|
||||
|
||||
#print "decode_gmcp:", data
|
||||
if data:
|
||||
splits = data.split(None, 1)
|
||||
cmdname = splits[0]
|
||||
|
|
@ -282,7 +277,6 @@ class TelnetOOB(object):
|
|||
args = tuple(struct)
|
||||
else:
|
||||
args = (struct,)
|
||||
#print "gmcp decode:", data, "->", cmdname, args, kwargs
|
||||
self.protocol.data_in(oob=(cmdname, args, kwargs))
|
||||
|
||||
# access methods
|
||||
|
|
@ -296,7 +290,6 @@ class TelnetOOB(object):
|
|||
args, kwargs (any): Arguments to OOB command.
|
||||
|
||||
"""
|
||||
#print "data_out:", encoded_oob
|
||||
if self.MSDP:
|
||||
encoded_oob = self.encode_msdp(cmdname, *args, **kwargs)
|
||||
self.protocol._write(IAC + SB + MSDP + encoded_oob + IAC + SE)
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@ class Ttype(object):
|
|||
except TypeError:
|
||||
pass
|
||||
|
||||
#print "incoming TTYPE option:", option
|
||||
|
||||
if self.ttype_step == 0:
|
||||
# just start the request chain
|
||||
self.protocol.requestNegotiation(TTYPE, SEND)
|
||||
|
|
@ -153,7 +151,6 @@ class Ttype(object):
|
|||
self.protocol.protocol_flags['TTYPE'][option.upper()] = True
|
||||
|
||||
self.protocol.protocol_flags['TTYPE']['init_done'] = True
|
||||
# print "TTYPE final:", self.protocol.protocol_flags['TTYPE']
|
||||
# we must sync ttype once it'd done
|
||||
self.protocol.handshake_done()
|
||||
self.ttype_step += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue