src/eric7/Templates/TemplateViewer.py

branch
eric7
changeset 10373
093dcebe5ecb
parent 10192
f457742dd3d6
child 10431
64157aeb0312
equal deleted inserted replaced
10372:1444b4bee64b 10373:093dcebe5ecb
129 129
130 def removeAllEntries(self): 130 def removeAllEntries(self):
131 """ 131 """
132 Public method to remove all template entries of this group. 132 Public method to remove all template entries of this group.
133 """ 133 """
134 for name in list(self.entries.keys())[:]: 134 for name in list(self.entries):
135 self.removeEntry(name) 135 self.removeEntry(name)
136 136
137 def hasEntry(self, name): 137 def hasEntry(self, name):
138 """ 138 """
139 Public method to check, if the group has an entry with the given name. 139 Public method to check, if the group has an entry with the given name.
287 template text (string) 287 template text (string)
288 @return a tuple of the expanded template text (string), the 288 @return a tuple of the expanded template text (string), the
289 number of lines (integer) and the length of the last line (integer) 289 number of lines (integer) and the length of the last line (integer)
290 """ 290 """
291 txt = self.template 291 txt = self.template
292 for var, val in list(varDict.items()): 292 for var, val in varDict.items():
293 txt = ( 293 txt = (
294 self.__expandFormattedVariable(var, val, txt) 294 self.__expandFormattedVariable(var, val, txt)
295 if var in self.formatedVariables 295 if var in self.formatedVariables
296 else txt.replace(var, val) 296 else txt.replace(var, val)
297 ) 297 )
725 variables = itm.getVariables() 725 variables = itm.getVariables()
726 varValues = self.__getPredefinedVars() 726 varValues = self.__getPredefinedVars()
727 727
728 # Remove predefined variables from list so user doesn't have to fill 728 # Remove predefined variables from list so user doesn't have to fill
729 # these values out in the dialog. 729 # these values out in the dialog.
730 for v in list(varValues.keys()): 730 for v in varValues:
731 if v in variables: 731 if v in variables:
732 variables.remove(v) 732 variables.remove(v)
733 733
734 if variables: 734 if variables:
735 if Preferences.getTemplates("SingleDialog"): 735 if Preferences.getTemplates("SingleDialog"):
909 """ 909 """
910 Public method to get all group names. 910 Public method to get all group names.
911 911
912 @return list of all group names (list of strings) 912 @return list of all group names (list of strings)
913 """ 913 """
914 groups = sorted(list(self.groups.keys())[:]) 914 groups = sorted(self.groups)
915 return groups 915 return groups
916 916
917 def removeGroup(self, itm): 917 def removeGroup(self, itm):
918 """ 918 """
919 Public method to remove a group. 919 Public method to remove a group.

eric ide

mercurial