#!/usr/bin/env python2.4 # """ A script to start the schooltool server from the source directory. """ import sys import os import site if sys.version_info < (2, 4): print >> sys.stderr, '%s: need Python 2.4 or later.' % sys.argv[0] print >> sys.stderr, 'Your python is %s' % sys.version sys.exit(1) here = os.path.dirname(os.path.realpath(__file__)) # find the config file config_file = os.path.join(here, 'cando.conf') if not os.path.exists(config_file): config_file = os.path.join(here, 'cando.conf.in') # Change the default config file name by prepending a command-line argument sys.argv.insert(1, '--config=' + config_file) # Remove this directory from path: sys.path[:] = [p for p in sys.path if os.path.abspath(p) != here] # add the src, eggs and Zope3/src to the python path and as sites so that eggs work eggs = os.path.join(here, 'eggs') plugins = os.path.join(here, 'plugins') sys.path.insert(0, eggs) sys.path.insert(0, plugins) import site site.addsitedir(eggs) site.addsitedir(plugins) # Now run the app import schooltool.app.main schooltool.app.main.StandaloneServer().main()