src/eric7/Templates/TemplateViewer.py

branch
eric7
changeset 9576
be9f8e7e42e0
parent 9482
a2bc06a54d9d
child 9624
b47dfa7a137d
equal deleted inserted replaced
9575:635b6c5a36e1 9576:be9f8e7e42e0
576 """ 576 """
577 fn, selectedFilter = EricFileDialog.getSaveFileNameAndFilter( 577 fn, selectedFilter = EricFileDialog.getSaveFileNameAndFilter(
578 self, 578 self,
579 self.tr("Export Templates"), 579 self.tr("Export Templates"),
580 "", 580 "",
581 self.tr("Templates Files (*.ecj);;" "All Files (*)"), 581 self.tr("Templates Files (*.ecj);;All Files (*)"),
582 "", 582 "",
583 EricFileDialog.DontConfirmOverwrite, 583 EricFileDialog.DontConfirmOverwrite,
584 ) 584 )
585 585
586 if fn: 586 if fn:
765 else: 765 else:
766 if len(indent) > 0: 766 if len(indent) > 0:
767 count += len(indent) 767 count += len(indent)
768 768
769 if "i_n_s_e_r_t_i_o_n" in txt and "s_e_l_e_c_t" in txt: 769 if "i_n_s_e_r_t_i_o_n" in txt and "s_e_l_e_c_t" in txt:
770 txt = "'Insertion and selection can not be in" " template together'" 770 txt = "'Insertion and selection can not be in template together'"
771 771
772 if "i_n_s_e_r_t_i_o_n" in txt: 772 if "i_n_s_e_r_t_i_o_n" in txt:
773 lines = 1 773 lines = 1
774 for aline in txt.splitlines(): 774 for aline in txt.splitlines():
775 count = aline.find("i_n_s_e_r_t_i_o_n") 775 count = aline.find("i_n_s_e_r_t_i_o_n")
1003 else: 1003 else:
1004 EricMessageBox.critical( 1004 EricMessageBox.critical(
1005 self, 1005 self,
1006 self.tr("Read Templates"), 1006 self.tr("Read Templates"),
1007 self.tr( 1007 self.tr(
1008 "<p>The templates file <b>{0}</b> could not be read." "</p>" 1008 "<p>The templates file <b>{0}</b> could not be read.</p>"
1009 ).format(filename), 1009 ).format(filename),
1010 ) 1010 )
1011 1011
1012 def __configure(self): 1012 def __configure(self):
1013 """ 1013 """

eric ide

mercurial