scripts for managing programming sessions
These days when I work on my stuff I use a script dat open a predefined set of files and tools depending on the repo I'm working in. The definitions are in configuration files that also can be maintained using scripts.
- binfab session.editconf
define the variables / tools to use in a session for a given repo. This opens the ".sessionrc" file
- binfab session.edittestconf
define the locations of testscripts and scripts to test for a given repo. This opens the ".rurc" file
It boils down to starting a couple of VI(m) sessions for groups of source files, FileFindR instances for some of these groups, having check-repo open, a dtree instance for the repo-specific notes, an an enlarged terminal window. The names the source file groups are defined with are also exported as environment variables to the terminal session, so that I can easily start the tools again should I close them by accident. To set up all of this I have the following cammand:
binfab session.start <project>
This also creates a little file containing the ids of the started processes, making it possible to close the session with
binfab session.end
which kills the processes involved. I also have a command to just show which processes are involved:
binfab session.get-info [<project>]
In case the file containing the process ids is not deleted when it should, making it look like a session for a project is still / already running, I made a function to remove it:
binfab session.delete <project>
It's actually rendered superfluous since I decided to add a "foce" parameter tot the "start" comand.
Killing processes felt a bit uneasy to me and had the disadvantage that the terminal session's command history wasn't preserved. So I made another function:
binfab session.create <project>
which uses the contents of .sessionrc to creates a script that is saved as <project>.session and can be sourced in a terminal session to change it into one for the project. This has the drawback that the tools started have to be shutdown by hand.
This collection also contains a function that perhaps is better at home in repo.py:
binfab session.newproject
To start a new (Python) software project in a standardized way. I intended this as an attempt to do something with regard to packaging which cn nowadays be done using various other tools (none of which Iuse).