def paste(self, e): if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert(False) txt = txt.split('\n')[0].strip('\r').strip('\n') log('paste: >%s<' % map(ord, txt)) self.insert_text(txt) self.finalize()
def paste(self,e): '''Paste windows clipboard. Assume single line strip other lines and end of line markers and trailing spaces''' #(Control-v) if self.enable_win32_clipboard: txt=clipboard.get_clipboard_text_and_convert(False) txt=txt.split("\n")[0].strip("\r").strip("\n") log("paste: >%s<"%map(ord,txt)) self.insert_text(txt)
def paste(self, e): '''Paste windows clipboard. Assume single line strip other lines and end of line markers and trailing spaces''' #(Control-v) if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert(False) txt = txt.split("\n")[0].strip("\r").strip("\n") log("paste: >%s<" % map(ord, txt)) self.insert_text(txt)
def ipython_paste(self, e): if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert(self.enable_ipython_paste_list_of_lists) if self.enable_ipython_paste_for_paths: if len(txt) < 300 and '\t' not in txt and '\n' not in txt: txt = txt.replace('\\', '/').replace(' ', '\\ ') self.insert_text(txt) self.finalize()
def ipython_paste(self, e): """Paste windows clipboard. If enable_ipython_paste_list_of_lists is True then try to convert tabseparated data to repr of list of lists or repr of array""" if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert( self.enable_ipython_paste_list_of_lists) if self.enable_ipython_paste_for_paths: if len(txt) < 300 and ("\t" not in txt) and ("\n" not in txt): txt = txt.replace("\\", "/").replace(" ", r"\ ") self.insert_text(txt)
def ipython_paste(self,e): '''Paste windows clipboard. If enable_ipython_paste_list_of_lists is True then try to convert tabseparated data to repr of list of lists or repr of array. If enable_ipython_paste_for_paths==True then change \\ to / and spaces to \space''' if self.enable_win32_clipboard: txt=clipboard.get_clipboard_text_and_convert( self.enable_ipython_paste_list_of_lists) if self.enable_ipython_paste_for_paths: if len(txt)<300 and ("\t" not in txt) and ("\n" not in txt): txt=txt.replace("\\","/").replace(" ",r"\ ") self.insert_text(txt)
def paste(self, e): """Paste windows clipboard. :kbd:`Control-v`. Assume single line strip other lines and end of line markers and trailing spaces. """ if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert(False) txt = txt.split("\n")[0].strip("\r").strip("\n") log("paste: >%s<" % list(map(ord, txt))) self.insert_text(txt) self.finalize()
def paste_mulitline_code(self, e): reg = re.compile('\r?\n') if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert(False) t = reg.split(txt) t = [ row for row in t if row.strip() != '' ] if t != ['']: self.insert_text(t[0]) self.add_history(self.l_buffer.copy()) self.paste_line_buffer = t[1:] log('multi: >%s<' % self.paste_line_buffer) return True return False self.finalize()
def paste_mulitline_code(self, e): """Paste windows clipboard""" reg = re.compile(r"\r?\n") if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert(False) t = reg.split(txt) t = [row for row in t if row.strip() != ""] # remove empty lines if t != [""]: self.insert_text(t[0]) self.add_history(self.l_buffer.copy()) self.paste_line_buffer = t[1:] log("multi: %s" % self.paste_line_buffer) return True else: return False
def paste_mulitline_code(self,e): '''Paste windows clipboard as multiline code. Removes any empty lines in the code''' reg=re.compile("\r?\n") if self.enable_win32_clipboard: txt=clipboard.get_clipboard_text_and_convert(False) t=reg.split(txt) t=[row for row in t if row.strip()!=""] #remove empty lines if t!=[""]: self.insert_text(t[0]) self.add_history(self.l_buffer.copy()) self.paste_line_buffer=t[1:] log("multi: %s"%self.paste_line_buffer) return True else: return False
def ipython_paste(self, e): """Paste windows clipboard. If `enable_ipython_paste_list_of_lists` is `True` then try to convert tab-separated data to `repr` of `list` of `lists` or `repr` of `array`. If `enable_ipython_paste_for_paths` is True then change :kbd:`\\` to :kbd:`/` and :kbd:`Space` to an escaped Space. """ if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert( self.enable_ipython_paste_list_of_lists ) if self.enable_ipython_paste_for_paths: if len(txt) < 300 and ("\t" not in txt) and ("\n" not in txt): txt = txt.replace("\\", "/").replace(" ", r"\ ") self.insert_text(txt) self.finalize()
def paste(self, e): """Paste windows clipboard""" if self.enable_win32_clipboard: txt = clipboard.get_clipboard_text_and_convert(False) self.insert_text(txt)