# HG changeset patch # User Goffi # Date 1461262840 -7200 # Node ID 827bb478d8afe8cf4b15d3ac2d0ba913b6cd9e73 # Parent 2c75011d7b2db038f15753153c802d9844c98faa primitivus: paste is now detected, and put in edit bar, so use can check and validate it diff -r 2c75011d7b2d -r 827bb478d8af frontends/src/primitivus/primitivus --- a/frontends/src/primitivus/primitivus Tue Apr 19 20:09:02 2016 +0200 +++ b/frontends/src/primitivus/primitivus Thu Apr 21 20:20:40 2016 +0200 @@ -361,6 +361,23 @@ def inputFilter(self, input_, raw): if self.__saved_overlay and input_ != a_key['OVERLAY_HIDE']: return + + if len(input_) > 1: # XXX: it may be needed to increase this value if buffer + # or other things result in several chars at once + # (e.g. using Primitivus through ssh). Need some testing + # and experience to adjust value. + log.debug(u"Paste detected") + try: + edit_bar = self.editBar + except AttributeError: + log.warning(u"Paste discarded: there is no edit bar yet") + else: + # XXX: if a paste is detected, we append it directly to the edit bar text + # so the use can check it and press [enter] if it's OK + buf_paste = u''.join((unichr(k) for k in raw)) + edit_bar.set_edit_text(u'{}{}'.format(edit_bar.edit_text, buf_paste)) + return + for i in input_: if isinstance(i,tuple): if i[0] == 'mouse press':