# eric6.VCS.StatusMonitorThread

Module implementing the VCS status monitor thread base class.

### Global Attributes

None

### Classes

VcsStatusMonitorThread | Class implementing the VCS status monitor thread base class.

### Functions

None

## VcsStatusMonitorThread

Class implementing the VCS status monitor thread base class.

### Signals

vcsStatusMonitorData(list of str)
  emitted to update the VCS status
vcsStatusMonitorInfo(str)
  emitted to signal some info of the monitoring thread
vcsStatusMonitorStatus(str, str)
  emitted to signal the status of the monitoring thread (ok, nok, op) and a status message

### Derived from

QThread

### Class Attributes

None

### Class Methods

None

### Methods

VcsStatusMonitorThread | Constructor
_getInfo | Protected method implementing the real info action.
_performMonitor | Protected method implementing the real monitoring action.
_shutdown | Protected method performing shutdown actions.
checkStatus | Public method to wake up the status monitor thread.
clearCachedState | Public method to clear the cached VCS state of a file/directory.
getAutoUpdate | Public method to retrieve the status of the auto update function.
getInterval | Public method to get the monitor interval.
run | Public method implementing the tasks action.
setAutoUpdate | Public method to enable the auto update function.
setInterval | Public method to change the monitor interval.
stop | Public method to stop the monitor thread.

### Static Methods

None

#### VcsStatusMonitorThread (Constructor)

VcsStatusMonitorThread(interval, project, vcs, parent=None)

Constructor

interval
  new interval in seconds (integer)
project
  reference to the project object (Project)
vcs
  reference to the version control object
parent
  reference to the parent object (QObject)

#### VcsStatusMonitorThread._getInfo

_getInfo()

Protected method implementing the real info action.

This method should be overridden and create a short info message to be shown in the main window status bar right next to the status indicator.

Returns:
  short info message

Return Type:
  str

#### VcsStatusMonitorThread._performMonitor

_performMonitor()

Protected method implementing the real monitoring action.

This method must be overridden and populate the statusList member variable with a list of strings giving the status in the first column and the path relative to the project directory starting with the third column. The allowed status flags are:

- "A" path was added but not yet comitted
- "M" path has local changes
- "O" path was removed
- "R" path was deleted and then re-added
- "U" path needs an update
- "Z" path contains a conflict
- " " path is back at normal

Returns:
  tuple of flag indicating successful operation (boolean) and a status message in case of non successful operation (string)

Raises RuntimeError:
  to indicate that this method must be implemented by a subclass

#### VcsStatusMonitorThread._shutdown

_shutdown()

Protected method performing shutdown actions.

The default implementation does nothing.

#### VcsStatusMonitorThread.checkStatus

checkStatus()

Public method to wake up the status monitor thread.

#### VcsStatusMonitorThread.clearCachedState

clearCachedState(name)

Public method to clear the cached VCS state of a file/directory.

name
  name of the entry to be cleared (string)

#### VcsStatusMonitorThread.getAutoUpdate

getAutoUpdate()

Public method to retrieve the status of the auto update function.

Returns:
  status of the auto update function (boolean)

#### VcsStatusMonitorThread.getInterval

getInterval()

Public method to get the monitor interval.

Returns:
  interval in seconds (integer)

#### VcsStatusMonitorThread.run

run()

Public method implementing the tasks action.

#### VcsStatusMonitorThread.setAutoUpdate

setAutoUpdate(auto)

Public method to enable the auto update function.

auto
  status of the auto update function (boolean)

#### VcsStatusMonitorThread.setInterval

setInterval(interval)

Public method to change the monitor interval.

interval
  new interval in seconds (integer)

#### VcsStatusMonitorThread.stop

stop()

Public method to stop the monitor thread.

Up