wc_track is a wrapper around sauron and stl that provides an initial implementation of per-project tracking and operation. See wc-track Manual for more information about use.
In most cases, you will not need to use wc_track from another Python module, although some of the data in the projects dictionary may be useful in other scripts. In the future the configuration of projects may be distinct from wc_track, but at the moment you will need to edit wc_track.py before installing and using wc-track.
Stores the current username. By default, uses os.getusername to get the username of the user that owns its process. Override if needed, and with caution.
Stores the path of a “personal” projects log file. Defaults to: ~/.stl/personal-stats-<hostname>.log, where <hostname> is the output of python.socket.gethostname(). Override as needed.
Stores the path of a “work” projects log file. Defaults to: ~/.stl/work-stats-<hostname>.log, where <hostname> is the output of noindex:python:socket.gethostname(). Override as needed.
A data structure (python dictionary) that stores configuration information for projects that you will use wc_track to collect data on regularly. for tracking.
Each project has a key in projects, which holds a dictionary. The keys of that dictionary map to the arguments to stl.generate_events()/stl. The projects the following keys:
The path to the project’s top level directory. wc_track passes this value as directory to stl.generate_events().
The name of the emacs daemon to send notifications about this project. wc_track passes this value as target to stl.generate_events().
A Boolean value. If True, send a notification to emacs via sauron. wc_track passes this value as emacs to stl.generate_events().
A Boolean value. If True, suppress all output on the console. wc_track passes this value as quiet to stl.generate_events().
A filesystem path to the log. Typically personal_log or work_log.
The extension of the project files. wc_track passes this value as quiet to stl.generate_events().
Parameters: |
|
---|
A helper method that takes two arguments. If the first is true, the method will return True (and override the projects.<project>.quiet,) otherwise set_quiet() returns the second value.
The core operation of the program. Includes the following operations:
See wc-track Manual for more information.
In most cases, there are few possible modifications or extensions to wc_track, but it serves as a good example for the kinds of modification and interfaces that you could provide to the kinds of personal statistic monitoring and recording as part of STL and future related tools.