def compact_to_tab(self): plain_rpt = get_str_report() if False:pass elif app_name=='CudaText': app.file_open('') ed.set_text_all(plain_rpt) elif app_name=='SynWrite': pass
def compact_to_tab(self): if app_name=='CudaText' and app.app_api_version()<'1.0.212': # depr PROC_GET_COMMAND, PROC_GET_COMMAND_PLUGIN app.msg_box(_('Plugin needs newer app version'), app.MB_OK) return plain_rpt = get_str_report() if False:pass elif app_name=='CudaText': app.file_open('') ed.set_text_all(plain_rpt) elif app_name=='SynWrite': pass
def compact_to_tab(self): if app_name=='CudaText' and app.app_api_version()<'1.0.212': # depr PROC_GET_COMMAND, PROC_GET_COMMAND_PLUGIN app.msg_box('Plugin needs newer app version', app.MB_OK) return plain_rpt = get_str_report() if False:pass elif app_name=='CudaText': app.file_open('') ed.set_text_all(plain_rpt) elif app_name=='SynWrite': pass
def do_rprt(self, aid, ag): m,M = self,CfgKeysDlg if False:pass elif aid=='trpt': # Compact report to tab app.file_open('') ed.set_text_all(get_str_report()) elif aid=='hrpt': # Full report to HTML htm_file = os.path.join(tempfile.gettempdir(), '{}_keymapping.html'.format(app_name)) do_report(htm_file) webbrowser.open_new_tab('file://'+htm_file) app.msg_status(_('Opened browser with file ')+htm_file) return []
def do_rprt(self, aid, ag, data=''): m,M = self,self.__class__ if False:pass elif aid=='trpt': # Compact report to tab app.file_open('') ed.set_text_all(get_str_report()) elif aid=='hrpt': # Full report to HTML htm_file = os.path.join(tempfile.gettempdir(), '{}_keymapping.html'.format(app_name)) do_report(htm_file) webbrowser.open_new_tab('file://'+htm_file) app.msg_status(_('Opened browser with file ')+htm_file) return []
def lineops_trim_right(self): ed.set_text_all("\n".join( map(lambda x: x.rstrip(), ed.get_text_all().split("\n"))))
def lineops_remove_dup(self): ed.set_text_all("\n".join(list([i[0] for i in groupby()])))
def lineops_remove_dup_all(self): ed.set_text_all("\n".join(list(set(ed.get_text_all().split("\n")))))
def lineops_sort_desc(self): ed.set_text_all("\n".join( sorted(ed.get_text_all().split("\n"), reverse=True)))
def lineops_sort_asc(self): ed.set_text_all("\n".join(sorted(ed.get_text_all().split("\n"))))
def lineops_remove_empty(self): ed.set_text_all("\n".join( list(filter(None, ed.get_text_all().split("\n")))))