ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/WEBTOOLS/cmsWeb.py
Revision: 1.2
Committed: Thu Mar 29 16:35:59 2007 UTC (18 years, 1 month ago) by eulisse
Content type: text/x-python
Branch: MAIN
CVS Tags: V00-09-00
Changes since 1.1: +33 -2 lines
Log Message:
Updated to be on par with PRODREQUEST version.

File Contents

# User Rev Content
1 eulisse 1.1 #!/usr/bin/env python
2     from Framework import BonsaiServer
3 eulisse 1.2 from Framework import Context
4     from optparse import OptionParser
5     from Framework import CmdLineArgs
6 eulisse 1.1
7     if __name__ == '__main__':
8 eulisse 1.2 context = Context ()
9     context.addService (OptionParser ())
10     context.OptionParser ().add_option ("--profile",
11     help="start server in profiler mode",
12     default=False,
13     action="store_true",
14     dest="profile")
15    
16     context.OptionParser ().add_option ("--base-url",
17     help="Base URL for the server (for usage behind a proxy).",
18     default="http://localhost:8030",
19     dest="baseUrl")
20    
21     app = BonsaiServer (context)
22    
23     opts, args = context.OptionParser ().parse_args ()
24     context.addService (CmdLineArgs (context.OptionParser ()))
25    
26     if opts.profile:
27     import pstats
28     try:
29     import cProfile as profile
30     except ImportError:
31     import profile
32     profile.run ('app.start ()', 'bonsaiProfiler')
33    
34     p = pstats.Stats('bonsaiProfiler')
35     p.strip_dirs().sort_stats(-1).print_stats()
36     else:
37     app.start ()