Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#10 Suggested changes, in particular wrt server configuration

Magnus Holmgren

As promised, here is a patch containing the changes I made while packaging PyScrabble for Debian. Initially I thought that OptionManager, ScrabbleServerFactory and ServerConsole should look for configuration files both in a system-wide location and in a user-specific location, but then I changed my mind and decided that it's enough if the client options and the server configuration can be in separate places, with the server log (pyscrabble.log, not server_history) and database further separated. So the patch does the following:

- Moves getLocaleDirs(), getResourceDirs(), getDataFiles(), and the distutils command subclasses InstallScripts and InstallLib from to They are only used by at installation time so I can't see why they would be needed outside it.

- Defines class Install(distutils.command.install) in order to add three more options to --logdir, --dbdir, and --confdir. InstallLib.generate_template() writes these to together with RESOURCE_PREFIX (hint: use %r instead of '%s' to get a representation rather than a string presentation).

- Defines class InstallData(distutils.command.install) because fix_path() needs the --confdir option value (instead of dist.get_app_data_dir()).

- Adds a resource "serverconfig" which ScrabbleServerFactory and ServerConsole looks for their config in. Doesn't use ResourceManager to find the location of the server DB or log - what's the point?

At least one problem remains: --confdir, --logdir, and --dbdir all have to be supplied currently, otherwise SERVER_CONFIG_DIR. SERVER_LOG_DIR, and SERVER_DB_DIR are set to None in, and there is no check for that in Some default should be provided, either in or in, or both.


  • Current patch used for Debian packaging

  • Logged In: YES
    Originator: YES

    One more thing: To comply with the FHS, data files should be under /usr/share/games/pyscrabble instead of /usr/share/pyscrabble.