Skip to content

Commit

Permalink
use an improved dump_packet() to simplify send(packet) logging
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@309 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 25, 2011
1 parent 60d16c0 commit 888ee42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/xpra/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def repr_ellipsized(obj, limit=100):
return repr(obj)

def dump_packet(packet):
return "[" + ", ".join([repr_ellipsized(x, 50) for x in packet]) + "]"
return "[" + ", ".join([repr_ellipsized(str(x), 50) for x in packet]) + "]"

def main_thread_call(fn, *args, **kwargs):
log("Queueing main thread call to %s" % (fn,))
Expand Down
11 changes: 4 additions & 7 deletions src/xpra/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def logp2(x):
log = Logger()

import xpra
from xpra.protocol import Protocol, SocketConnection
from xpra.protocol import Protocol, SocketConnection, dump_packet
from xpra.keys import mask_to_names
from xpra.xposix.xclipboard import ClipboardProtocolHelper
from xpra.xposix.xsettings import XSettingsManager
Expand Down Expand Up @@ -786,7 +786,7 @@ def do_wimpiggy_cursor_event(self, event):
self.send_cursor()

def send_cursor(self):
self._send(["cursor", self.cursor_image or ""], "cursor")
self._send(["cursor", self.cursor_image or ""])

def _bell_signaled(self, wm, event):
log("_bell_signaled(%s,%r)" % (wm, event))
Expand Down Expand Up @@ -1024,12 +1024,9 @@ def _move_pointer(self, pos):
display = gtk.gdk.display_get_default()
display.warp_pointer(display.get_default_screen(), x, y)

def _send(self, packet, packetlog=None):
def _send(self, packet):
if self._protocol is not None:
if packetlog:
log("Queuing packet: %s", packetlog)
else:
log("Queuing packet: %s", packet)
log("Queuing packet: %s", dump_packet(packet))
self._protocol.source.queue_ordinary_packet(packet)

def _raw_send(self, proto, packet):
Expand Down

0 comments on commit 888ee42

Please sign in to comment.