wc-track is a simplified wrapper around stl with stored configuration.
Returns a brief help message regarding available options and output.
By default stl caches a copy of the word count for each project in the /tmp/stl/ directory. If you pass --force, wc-track will log and notify on all word-count events even if the value has not changed since the last time wc-track ran.
The name of the project. You must specify one of the projects defined in the projects Configuration by the <project> value.
If you do not specify --project, wc-track will report all projects defined in the projects structure.
projects is a python dict, that holds a number of dicts for each project that you want to report on with stl. Consider the following prototypical project configuration:
'<project>' : {
'path' : <path>
'target' : <string>
'emacs' : <bool>
'quiet' : <bool>
'log' : <path>
'ext' : <string>
}
Consider the following documentation of each of these fields:
Holds the name of the project. Used as stl --project.
Holds the path to the top level of the project. Used as stl --directory.
Holds the name of the emacs instance to send the Sauron notification. Used as sauron --target.
A Boolean value. If False, this will disable output to emacs and Sauron.
A Boolean value. If true, will suppress all command line output. Used as stl --quiet.
Holds the path of the log file to record output data. Used as stl --log.
Holds the extension of all project files, that stl will measure. All files with different extensions ignored. Used as stl --extension.
At the system shell, invoke wc-track as in one of the following examples.
wc-track
wc-track --project rhizome
wc-track -f --project rhizome
Often it makes sense to run this program automatically using cron or some other scheduling tool. Consider the following crontab lines:
*/2 9-18 * * 1-5 wc-track > /dev/null 2>&1
*/2 * * * * wc-track > /dev/null 2>&1
The first operation schedules wc-track to run every two minutes, between 9 am and 6 pm, Monday through Friday. The second operation runs wc-track every two minutes at all times.
Typically there is no need to use wc_track from other Python scripts, and no interface for that; however, you may want to access the projects structure in another script as needed:
from wc_track import projects as wc_track_projects