Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
17 from .SvnDialogMixin import SvnDialogMixin 17 from .SvnDialogMixin import SvnDialogMixin
18 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog 18 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog
19 19
20 import Utilities 20 import Utilities
21 21
22
22 class SvnBlameDialog(QDialog, SvnDialogMixin, Ui_SvnBlameDialog): 23 class SvnBlameDialog(QDialog, SvnDialogMixin, Ui_SvnBlameDialog):
23 """ 24 """
24 Class implementing a dialog to show the output of the svn blame command. 25 Class implementing a dialog to show the output of the svn blame command.
25 """ 26 """
26 def __init__(self, vcs, parent = None): 27 def __init__(self, vcs, parent=None):
27 """ 28 """
28 Constructor 29 Constructor
29 30
30 @param vcs reference to the vcs object 31 @param vcs reference to the vcs object
31 @param parent parent widget (QWidget) 32 @param parent parent widget (QWidget)
75 for annotation in annotations: 76 for annotation in annotations:
76 self.__generateItem(annotation["revision"].number, 77 self.__generateItem(annotation["revision"].number,
77 annotation["author"], annotation["number"] + 1, annotation["line"]) 78 annotation["author"], annotation["number"] + 1, annotation["line"])
78 except pysvn.ClientError as e: 79 except pysvn.ClientError as e:
79 locker.unlock() 80 locker.unlock()
80 self.__showError(e.args[0]+'\n') 81 self.__showError(e.args[0] + '\n')
81 self.__finish() 82 self.__finish()
82 os.chdir(cwd) 83 os.chdir(cwd)
83 84
84 def __finish(self): 85 def __finish(self):
85 """ 86 """
118 @param revision revision string (string) 119 @param revision revision string (string)
119 @param author author of the change (string) 120 @param author author of the change (string)
120 @param lineno linenumber (string) 121 @param lineno linenumber (string)
121 @param text line of text from the annotated file (string) 122 @param text line of text from the annotated file (string)
122 """ 123 """
123 itm = QTreeWidgetItem(self.blameList, 124 itm = QTreeWidgetItem(self.blameList,
124 ["{0:d}".format(revision), author, "{0:d}".format(lineno), text]) 125 ["{0:d}".format(revision), author, "{0:d}".format(lineno), text])
125 itm.setTextAlignment(0, Qt.AlignRight) 126 itm.setTextAlignment(0, Qt.AlignRight)
126 itm.setTextAlignment(2, Qt.AlignRight) 127 itm.setTextAlignment(2, Qt.AlignRight)
127 128
128 def __showError(self, msg): 129 def __showError(self, msg):

eric ide

mercurial