usf-team team mailing list archive
-
usf-team team
-
Mailing list archive
-
Message #00011
Re: new_config.py: Directories
Sounds good to me.
On Tue, Jan 26, 2010 at 12:25 PM, Edwin Marshall <aspidites@xxxxxxxxx> wrote:
> 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.
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~usf-team
> Post to : usf-team@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~usf-team
> More help : https://help.launchpad.net/ListHelp
>
--
Kizzo Kilgore
Computer Science Undergraduate
San Jose State University
References