#!/usr/bin/python2.4

import os
import pf
import pf_janrain

# Optionally set pf.darcs_command if it isn't in /usr/bin/darcs.

# Get some directories to run the factory code.
home = os.environ['HOME']
local_dir = home + '/projects'

# Specify project name => [module, ...]
project_modules = {
    'phpstack': ['yadis', 'openid', 'buildbot'],
    'rubystack': ['yadis', 'openid'],
    }

# Create pf.Operation instance lists using factory code.
projects = dict([(name, pf_janrain.janrainProjectMaker(local_dir, name, mods))
                 for name, mods in project_modules.iteritems()])

if __name__ == "__main__":
    # Run a helper function that does sys.argv checking, usage output,
    # and exception handling.  If you don't like this, use
    # pf.run(projects, action, project_name) directly (it's called by
    # runWithArgs).  Optionally, runWithArgs honors an environment
    # variable as the source of the project name.  If not found there,
    # sys.argv will be checked.
    pf.runWithArgs(projects, env_proj_name='PROJECT')
