CodeManager.py Finished

This program extracts code listings and puts them in appropriate places in the code tree off the root directory of the download. If you edit a code file, the program will also take your edits and incorporate them into the .rst file where they came from. I’ve tried to put numerous checks in to make sure that the program doesn’t accidently stomp on anything.

If you say python CodeManager.py help (or anything it doesn’t understand), it tells you its options:

Command line options:

update:

        Refresh external code files into .rst files.

extract:

Pull the code listings from the .rst files and write each listing into its own file. Will not overwrite if code files and .rst files disagree unless you say “extract -force”.

check:

Ensure that external code files exist and check which external files have changed from what’s in the .rst files. Generate files in the _deltas subdirectory showing what has changed.

display:

        Print all the code listings in the .rst files.

I think I’ve done some interesting things with the design of this program so I”m planning to blog about it; it will go into the “Comprehensions” chapter because it uses a lot of them, but it also has a couple of interesting design patterns.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: