eric6/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditPlanEditor.py

branch
maintenance
changeset 8273
698ae46f40a4
parent 8234
fcb6b4b96274
equal deleted inserted replaced
8190:fb0ef164f536 8273:698ae46f40a4
28 @param item reference to the item 28 @param item reference to the item
29 @type QTreeWidgetItem 29 @type QTreeWidgetItem
30 @param column column number inside the tree widget item 30 @param column column number inside the tree widget item
31 @type int 31 @type int
32 """ 32 """
33 super(HgHisteditPlanActionComboBox, self).__init__() 33 super().__init__()
34 34
35 self.__item = item 35 self.__item = item
36 self.__column = column 36 self.__column = column
37 37
38 self.addItems(["pick", "drop", "mess", "fold", "roll", "edit"]) 38 self.addItems(["pick", "drop", "mess", "fold", "roll", "edit"])
64 64
65 This is reimplemented in order to set the associated item as the 65 This is reimplemented in order to set the associated item as the
66 current item of the tree widget. 66 current item of the tree widget.
67 """ 67 """
68 self.__item.treeWidget().setCurrentItem(self.__item) 68 self.__item.treeWidget().setCurrentItem(self.__item)
69 super(HgHisteditPlanActionComboBox, self).showPopup() 69 super().showPopup()
70 70
71 71
72 class HgHisteditPlanEditor(QDialog, Ui_HgHisteditPlanEditor): 72 class HgHisteditPlanEditor(QDialog, Ui_HgHisteditPlanEditor):
73 """ 73 """
74 Class implementing a dialog to edit the history modification plan. 74 Class implementing a dialog to edit the history modification plan.
81 to be edited 81 to be edited
82 @type str 82 @type str
83 @param parent reference to the parent widget 83 @param parent reference to the parent widget
84 @type QWidget 84 @type QWidget
85 """ 85 """
86 super(HgHisteditPlanEditor, self).__init__(parent) 86 super().__init__(parent)
87 self.setupUi(self) 87 self.setupUi(self)
88 88
89 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow")) 89 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow"))
90 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow")) 90 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow"))
91 91
148 148
149 parts = text.split(" ", 3) 149 parts = text.split(" ", 3)
150 action = parts[0] 150 action = parts[0]
151 try: 151 try:
152 rev = int(parts[2]) 152 rev = int(parts[2])
153 if len(parts) > 3: 153 summary = parts[3] if len(parts) > 3 else ""
154 summary = parts[3]
155 else:
156 summary = ""
157 except ValueError: 154 except ValueError:
158 rev = -1 155 rev = -1
159 summary = " ".join(parts[2:]) 156 summary = " ".join(parts[2:])
160 if rev > -1: 157 revision = ("{0:>7}:{1}".format(rev, parts[1])
161 revision = "{0:>7}:{1}".format(rev, parts[1]) 158 if rev > -1 else parts[1])
162 else:
163 revision = parts[1]
164 159
165 itm = QTreeWidgetItem(self.planTreeWidget, [ 160 itm = QTreeWidgetItem(self.planTreeWidget, [
166 action, 161 action,
167 revision, 162 revision,
168 summary, 163 summary,

eric ide

mercurial