Skip to content

Commit 21bd07f

Browse files
author
Paul Sokolovsky
committed
webrepl_cli.py: Turn off debug output.
1 parent e901995 commit 21bd07f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

webrepl_cli.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@
1313
# Treat this remote directory as a root for file transfers
1414
SANDBOX = ""
1515
#SANDBOX = "/tmp/webrepl/"
16-
16+
DEBUG = 0
1717

1818
WEBREPL_FILE = "<2sBBQLH64s"
1919

20+
21+
def debugmsg(msg):
22+
if DEBUG:
23+
print(msg)
24+
25+
2026
if USE_BUILTIN_WEBSOCKET:
2127
from websocket import websocket
2228
else:
@@ -58,10 +64,10 @@ def read(self, size):
5864
(sz,) = struct.unpack(">H", hdr)
5965
if fl == 0x82:
6066
break
61-
print("Got unexpected websocket record of type %x, skipping it" % fl)
67+
debugmsg("Got unexpected websocket record of type %x, skipping it" % fl)
6268
while sz:
6369
skip = self.s.recv(sz)
64-
print("Skip data:", skip)
70+
debugmsg("Skip data: %s" % skip)
6571
sz -= len(skip)
6672
data = self.recvexactly(sz)
6773
assert len(data) == sz

0 commit comments

Comments
 (0)