56 """ |
56 """ |
57 while not self.__stopIt: |
57 while not self.__stopIt: |
58 # perform the checking task |
58 # perform the checking task |
59 self.statusList = [] |
59 self.statusList = [] |
60 self.vcsStatusMonitorStatus.emit( |
60 self.vcsStatusMonitorStatus.emit( |
61 "wait", self.trUtf8("Waiting for lock")) |
61 "wait", self.tr("Waiting for lock")) |
62 try: |
62 try: |
63 locked = self.vcs.vcsExecutionMutex.tryLock(5000) |
63 locked = self.vcs.vcsExecutionMutex.tryLock(5000) |
64 except TypeError: |
64 except TypeError: |
65 locked = self.vcs.vcsExecutionMutex.tryLock() |
65 locked = self.vcs.vcsExecutionMutex.tryLock() |
66 if locked: |
66 if locked: |
67 try: |
67 try: |
68 self.vcsStatusMonitorStatus.emit( |
68 self.vcsStatusMonitorStatus.emit( |
69 "op", self.trUtf8("Checking repository status")) |
69 "op", self.tr("Checking repository status")) |
70 res, statusMsg = self._performMonitor() |
70 res, statusMsg = self._performMonitor() |
71 finally: |
71 finally: |
72 self.vcs.vcsExecutionMutex.unlock() |
72 self.vcs.vcsExecutionMutex.unlock() |
73 if res: |
73 if res: |
74 status = "ok" |
74 status = "ok" |
75 else: |
75 else: |
76 status = "nok" |
76 status = "nok" |
77 self.vcsStatusMonitorStatus.emit( |
77 self.vcsStatusMonitorStatus.emit( |
78 "send", self.trUtf8("Sending data")) |
78 "send", self.tr("Sending data")) |
79 self.vcsStatusMonitorData.emit(self.statusList) |
79 self.vcsStatusMonitorData.emit(self.statusList) |
80 self.vcsStatusMonitorStatus.emit(status, statusMsg) |
80 self.vcsStatusMonitorStatus.emit(status, statusMsg) |
81 else: |
81 else: |
82 self.vcsStatusMonitorStatus.emit( |
82 self.vcsStatusMonitorStatus.emit( |
83 "timeout", self.trUtf8("Timed out waiting for lock")) |
83 "timeout", self.tr("Timed out waiting for lock")) |
84 |
84 |
85 if self.autoUpdate and self.shouldUpdate: |
85 if self.autoUpdate and self.shouldUpdate: |
86 self.vcs.vcsUpdate(self.projectDir, True) |
86 self.vcs.vcsUpdate(self.projectDir, True) |
87 continue # check again |
87 continue # check again |
88 self.shouldUpdate = False |
88 self.shouldUpdate = False |