~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Michael Hudson
  • Date: 2009-04-01 14:40:05 UTC
  • Revision ID: michael.hudson@canonical.com-20090401144005-trxdnfy5hd5wrd39
a quick dose of IE compatibility:
* ''.splice behaves differently
* io-queue doesn't seem to work, but isn't useful for me anyway...

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        config.print_help()
45
45
        sys.exit(1)
46
46
    elif config.arg_count == 1:
47
 
        path = config.get_arg(0)
 
47
        [path] = args
48
48
    else:
49
49
        path = '.'
50
50
 
63
63
            return Reloader.restart_with_reloader()
64
64
 
65
65
    if config.get_option('user_dirs'):
66
 
        if not config.get_option('trunk_dir'):
 
66
        if not config.get_option['trunk_dir']:
67
67
            print "You didn't specify a directory for the trunk directories."
68
68
            sys.exit(1)
69
 
        app = UserBranchesFromFileSystemRoot(path, config)
 
69
        app = UserBranchesFromFileSystemRoot(
 
70
            path, config.get_option('trunk_dir'))
70
71
    else:
71
 
        app = BranchesFromFileSystemRoot(path, config)
 
72
        app = BranchesFromFileSystemRoot(path)
72
73
 
73
74
    # setup_logging()
74
75
    logging.basicConfig()
76
77
    logger = getattr(app, 'log', logging.getLogger('loggerhead'))
77
78
    if config.get_option('log_folder'):
78
79
        logfile_path = os.path.join(
79
 
            config.get_option('log_folder'), 'serve-branches.log')
 
80
            config.get_option['log_folder'], 'serve-branches.log')
80
81
    else:
81
82
        logfile_path = 'serve-branches.log'
82
83
    logfile = logging.FileHandler(logfile_path, 'a')
86
87
    logfile.setLevel(logging.DEBUG)
87
88
    logger.addHandler(logfile)
88
89
 
 
90
    if config.get_option('memory_profile'):
 
91
        memprofile = logging.getLogger('loggerhead-memprofile')
 
92
        memprofile.setLevel(logging.DEBUG)
 
93
        memprofile.addHandler(logging.FileHandler('loggerhead-memprofile'))
 
94
 
89
95
    # setup_logging() #end
90
96
 
91
97
    app = TransLogger(app, logger=logger)
93
99
        from loggerhead.middleware.profile import LSProfMiddleware
94
100
        app = LSProfMiddleware(app)
95
101
    if config.get_option('memory_profile'):
96
 
        from dozer import Dozer
97
 
        app = Dozer(app)
 
102
        from loggerhead.middleware.profile import MemoryProfileMiddleware
 
103
        app = MemoryProfileMiddleware(app)
98
104
 
99
105
    if not config.get_option('user_prefix'):
100
106
        prefix = '/'