30 """ |
31 """ |
31 VcsStatusMonitorThread.__init__(self, interval, project, vcs, parent) |
32 VcsStatusMonitorThread.__init__(self, interval, project, vcs, parent) |
32 |
33 |
33 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
34 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
34 |
35 |
35 self.rx_status1 = QRegExp('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*') |
36 self.rx_status1 = re.compile('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*') |
36 self.rx_status2 = QRegExp( |
37 self.rx_status2 = re.compile( |
37 '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+(\\S+)\\s+(.+)\\s*') |
38 '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+(\\S+)\\s+(.+)\\s*') |
38 |
39 |
39 def _performMonitor(self): |
40 def _performMonitor(self): |
40 """ |
41 """ |
41 Protected method implementing the monitoring action. |
42 Protected method implementing the monitoring action. |
74 if finished and process.exitCode() == 0: |
75 if finished and process.exitCode() == 0: |
75 output = str(process.readAllStandardOutput(), |
76 output = str(process.readAllStandardOutput(), |
76 self.__ioEncoding, 'replace') |
77 self.__ioEncoding, 'replace') |
77 states = {} |
78 states = {} |
78 for line in output.splitlines(): |
79 for line in output.splitlines(): |
79 if self.rx_status1.exactMatch(line): |
80 match = ( |
80 flags = self.rx_status1.cap(1) |
81 self.rx_status1.fullmatch(line) or |
81 path = self.rx_status1.cap(3).strip() |
82 self.rx_status2.fullmatch(line) |
82 elif self.rx_status2.exactMatch(line): |
83 ) |
83 flags = self.rx_status2.cap(1) |
84 if match is None: |
84 path = self.rx_status2.cap(5).strip() |
|
85 else: |
|
86 continue |
85 continue |
|
86 elif match.re is self.rx_status1: |
|
87 flags = match.group(1) |
|
88 path = match.group(3).strip() |
|
89 elif match.re is self.rx_status2: |
|
90 flags = match.group(1) |
|
91 path = match.group(5).strip() |
87 if ( |
92 if ( |
88 flags[0] in "ACDMR" or |
93 flags[0] in "ACDMR" or |
89 (flags[0] == " " and flags[-1] == "*") |
94 (flags[0] == " " and flags[-1] == "*") |
90 ): |
95 ): |
91 if flags[-1] == "*": |
96 if flags[-1] == "*": |