#!<> """ A script to start the schooltool server from the source directory. """ import sys import os.path import site ZOPE_SOFTWARE_HOME = r"<>" SCHOOLTOOL_SOFTWARE_HOME = r"<>" INSTANCE_HOME = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) CONFIG_FILE = os.path.join(INSTANCE_HOME, "etc", "schooltool.conf") def run(): 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) # This removes the script directory from sys.path, which we do # since there are no modules here. # basepath = filter(None, sys.path) sys.path[:] = [os.path.join(INSTANCE_HOME, "lib", "python"), SCHOOLTOOL_SOFTWARE_HOME, ZOPE_SOFTWARE_HOME] + basepath site.addsitedir(ZOPE_SOFTWARE_HOME) site.addsitedir(SCHOOLTOOL_SOFTWARE_HOME) site.addsitedir(os.path.join(INSTANCE_HOME, "lib", "python")) from schooltool.app import main main.MANAGER_USERNAME = r"<>" main.MANAGER_PASSWORD = r"<>" main.StandaloneServer().main(sys.argv + ['--config', CONFIG_FILE]) if __name__ == '__main__': run()