Skip to content

Commit

Permalink
fix pylint warnings, don't lookup handler twice, add warning messages…
Browse files Browse the repository at this point in the history
… when x11 bits can't be loaded, don't use arrays when tuples will do

git-svn-id: https://xpra.org/svn/Xpra/trunk@21743 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 20, 2019
1 parent 488ac2d commit 3c76a7e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/xpra/client/gtk_base/gtk_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,7 @@ def setup_clipboard_helper(self, helperClass):
})
clipboardlog("setup_clipboard_helper() kwargs=%s", kwargs)
def clipboard_send(*parts):
clipboardlog("clipboard_send: %s", parts[0])
if not self.clipboard_enabled:
clipboardlog("clipboard is disabled, not sending clipboard packet")
return
Expand Down
8 changes: 6 additions & 2 deletions src/xpra/client/mixins/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def init_authenticated_packet_handlers(self):
})

def get_clipboard_helper_classes(self):
return []
return ()

def make_clipboard_helper(self):
"""
Expand All @@ -160,9 +160,13 @@ def make_clipboard_helper(self):
log.error(" %s", e)
del e
except:
log.error("cannot instantiate %s", helperclass, exc_info=True)
log.error("Error: cannot instantiate %s", helperclass, exc_info=True)
return None

def setup_clipboard_helper(self, helperClass):
raise NotImplementedError()


def _process_clipboard_packet(self, packet):
ch = self.clipboard_helper
log("process_clipboard_packet: %s, helper=%s", bytestostr(packet[0]), ch)
Expand Down
12 changes: 8 additions & 4 deletions src/xpra/clipboard/clipboard_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def process_clipboard_packet(self, packet):
handler = self._packet_handlers.get(packet_type)
log("process clipboard handler(%s)=%s", packet_type, handler)
if handler:
self._packet_handlers[packet_type](packet)
handler(packet)
else:
log.warn("Warning: no clipboard packet handler for '%s'", packet_type)

Expand Down Expand Up @@ -644,7 +644,9 @@ def __init__(self, selection):
try:
from xpra.x11.gtk_x11.prop import prop_get
self.prop_get = prop_get
except ImportError:
except ImportError as e:
log.warn("Warning: limited support for clipboard properties")
log.warn(" %s", e)
self.prop_get = None

self._loop_uuid = ""
Expand Down Expand Up @@ -703,8 +705,10 @@ def __repr__(self):
def do_owner_changed(self, *_args):
#an application on our side owns the clipboard selection
#(they are ready to provide something via the clipboard)
log("clipboard: %s owner_changed, enabled=%s, can-send=%s, can-receive=%s, have_token=%s, greedy_client=%s, block_owner_change=%s",
bytestostr(self._selection), self._enabled, self._can_send, self._can_receive, self._have_token, self._greedy_client, self._block_owner_change)
log("clipboard: %s owner_changed, enabled=%s, "+
"can-send=%s, can-receive=%s, have_token=%s, greedy_client=%s, block_owner_change=%s",
bytestostr(self._selection), self._enabled, self._can_send, self._can_receive,
self._have_token, self._greedy_client, self._block_owner_change)
if not self._enabled or self._block_owner_change:
return
if self._have_token or (self._greedy_client and self._can_send):
Expand Down

0 comments on commit 3c76a7e

Please sign in to comment.