Package eggbasket :: Module commands
[hide private]

Module commands

source code

This module contains functions called from console script entry points.

Classes [hide private]
  ConfigurationError
Functions [hide private]
 
find_config(args)
Return for environment-specific configuration in several places.
source code
 
init_database(args)
Create bootstrap data in the database specified by the given config file.
source code
 
start_server(args)
Start the CherryPy application server.
source code
 
main() source code
Variables [hide private]
  log = logging.getLogger("eggbasket")
Function Details [hide private]

find_config(args)

source code 

Return for environment-specific configuration in several places.

First look on the command line for a desired config file, if it's not on the command line, then look for 'setup.py' in the current directory. If there, load configuration from a file called 'dev.cfg'. If it's not there, the project is probably installed and we'll look first for a file called 'prod.cfg' in the current directory and then for a default config file called 'default.cfg' packaged in the egg.

If all fails, raise ConfigurationError.

init_database(args)

source code 

Create bootstrap data in the database specified by the given config file.

This will create a user with user_name/password "admin", who belongs to the group "maintainers", which has the "upload" permission.

This function can safely be run several times for the same database. If a a user with user_name == 'admin' already exists, it does nothing.