wc-track Manual

Synopsis

wc-track is a simplified wrapper around stl with stored configuration.

Options

--help, -h

Returns a brief help message regarding available options and output.

--force, -f

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.

--project <project-name>, -p <p>

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 Configuration

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:

projects

Holds the name of the project. Used as stl --project.

projects.'path'

Holds the path to the top level of the project. Used as stl --directory.

projects.'target'

Holds the name of the emacs instance to send the Sauron notification. Used as sauron --target.

projects.'emacs'

A Boolean value. If False, this will disable output to emacs and Sauron.

projects.'quiet'

A Boolean value. If true, will suppress all command line output. Used as stl --quiet.

projects.'log'

Holds the path of the log file to record output data. Used as stl --log.

projects.'ext'

Holds the extension of all project files, that stl will measure. All files with different extensions ignored. Used as stl --extension.

Use

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