def __init__(self, send_packet_cb, progress_cb=None, clipboards=CLIPBOARDS, filter_res=None): ClipboardProtocolHelperBase.__init__(self, send_packet_cb, progress_cb, clipboards, filter_res)
def __init__(self, send_packet_cb, progress_cb=None, local_clipboard="CLIPBOARD", remote_clipboard="CLIPBOARD"): self.local_clipboard = local_clipboard self.remote_clipboard = remote_clipboard ClipboardProtocolHelperBase.__init__(self, send_packet_cb, progress_cb, [local_clipboard])
def __init__(self, *args, **kwargs): def getselection(name): v = kwargs.get("clipboard.%s" % name) #ie: clipboard.remote env_value = os.environ.get("XPRA_TRANSLATEDCLIPBOARD_%s_SELECTION" % name.upper()) selections = kwargs.get("clipboards.%s" % name) #ie: clipboards.remote assert selections, "no %s clipboards!" % name for x in (env_value, v): if x and x in selections: return x return selections[0] self.local_clipboard = getselection("local") self.remote_clipboard = getselection("remote") log("TranslatedClipboardProtocolHelper local=%s, remote=%s", self.local_clipboard, self.remote_clipboard) #the local clipboard cannot be changed! #we tell the superclass to only initialize this proxy: kwargs["clipboards.local"] = [self.local_clipboard] #this one can be changed (we send a packet to change the enabled selections) kwargs["clipboards.remote"] = [self.remote_clipboard] ClipboardProtocolHelperBase.__init__(self, *args, **kwargs)