usf-team team mailing list archive
-
usf-team team
-
Mailing list archive
-
Message #00010
new_config.py: Directories
As mentioned before, I am rewriting config.py to use the built-in module SafeConfigParser, which I believe will simplify how we look access config options throughout the code. By default, usf uses the options MEDIA_DIRECTORY, SHARE_DIRECTORY, BIN_DIRECTORY, and GAME_DIRECTORY to locate various things. I find a problems with this:
1. This forces us to write multiple default configs for different platforms.
2. In accomplishing #1, we are forced to make certain assumptions about where files should be located under a certain platform
3. If these options are omitted (through deletion or any other means), usf breaks.
4. SHARE_DIRECTORY is going to sound foreign to windows users.
5. the directory locations are all identical for windows users, except usf_media, which should be implicit, not explicit.
My solution to this is two fold:
1. Write a setup.py that will install the correct files into the correct location, depending on the platform, and allow for custom install locations using the familiar --prefix= variable.
2. Replace MEDIA_DIRECTORY, SHARE_DIRECTORY, BIN_DIRECTORY, GAME_DIRECTORY with PREFIX variable, which is only set if "--prefix=" was used during installation, otherwise, fallback to the value of sys.prefix. Of course, a user may set this variable after installation if he wants. In either case, the contents of PREFIX are searched, and if not present, the default is used as a fallback.
Anyways, before I can continue work on new_config.py, I need to write a setup.py script. Incidentally, this will simplify package creation :-). Stay tuned for updates.
Follow ups