15 from PyQt4.QtGui import * |
15 from PyQt4.QtGui import * |
16 |
16 |
17 from .SvnDialogMixin import SvnDialogMixin |
17 from .SvnDialogMixin import SvnDialogMixin |
18 from .Ui_SvnPropListDialog import Ui_SvnPropListDialog |
18 from .Ui_SvnPropListDialog import Ui_SvnPropListDialog |
19 |
19 |
|
20 |
20 class SvnPropListDialog(QWidget, SvnDialogMixin, Ui_SvnPropListDialog): |
21 class SvnPropListDialog(QWidget, SvnDialogMixin, Ui_SvnPropListDialog): |
21 """ |
22 """ |
22 Class implementing a dialog to show the output of the svn proplist command process. |
23 Class implementing a dialog to show the output of the svn proplist command process. |
23 """ |
24 """ |
24 def __init__(self, vcs, parent = None): |
25 def __init__(self, vcs, parent=None): |
25 """ |
26 """ |
26 Constructor |
27 Constructor |
27 |
28 |
28 @param vcs reference to the vcs object |
29 @param vcs reference to the vcs object |
29 @param parent parent widget (QWidget) |
30 @param parent parent widget (QWidget) |
50 |
51 |
51 def __resort(self): |
52 def __resort(self): |
52 """ |
53 """ |
53 Private method to resort the tree. |
54 Private method to resort the tree. |
54 """ |
55 """ |
55 self.propsList.sortItems(self.propsList.sortColumn(), |
56 self.propsList.sortItems(self.propsList.sortColumn(), |
56 self.propsList.header().sortIndicatorOrder()) |
57 self.propsList.header().sortIndicatorOrder()) |
57 |
58 |
58 def __resizeColumns(self): |
59 def __resizeColumns(self): |
59 """ |
60 """ |
60 Private method to resize the list columns. |
61 Private method to resize the list columns. |
70 @param propName name of the property (string) |
71 @param propName name of the property (string) |
71 @param propValue value of the property (string) |
72 @param propValue value of the property (string) |
72 """ |
73 """ |
73 QTreeWidgetItem(self.propsList, [path, propName, propValue]) |
74 QTreeWidgetItem(self.propsList, [path, propName, propValue]) |
74 |
75 |
75 def start(self, fn, recursive = False): |
76 def start(self, fn, recursive=False): |
76 """ |
77 """ |
77 Public slot to start the svn status command. |
78 Public slot to start the svn status command. |
78 |
79 |
79 @param fn filename(s) (string or list of strings) |
80 @param fn filename(s) (string or list of strings) |
80 @param recursive flag indicating a recursive list is requested |
81 @param recursive flag indicating a recursive list is requested |
92 locker = QMutexLocker(self.vcs.vcsExecutionMutex) |
93 locker = QMutexLocker(self.vcs.vcsExecutionMutex) |
93 cwd = os.getcwd() |
94 cwd = os.getcwd() |
94 os.chdir(dname) |
95 os.chdir(dname) |
95 try: |
96 try: |
96 for name in fnames: |
97 for name in fnames: |
97 proplist = self.client.proplist(name, recurse = recursive) |
98 proplist = self.client.proplist(name, recurse=recursive) |
98 counter = 0 |
99 counter = 0 |
99 for path, prop in proplist: |
100 for path, prop in proplist: |
100 for propName, propVal in list(prop.items()): |
101 for propName, propVal in list(prop.items()): |
101 self.__generateItem(path, propName, propVal) |
102 self.__generateItem(path, propName, propVal) |
102 self.propsFound = True |
103 self.propsFound = True |