~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Paul Hummer
  • Date: 2009-03-31 22:24:14 UTC
  • mfrom: (315.1.5 config-cleanup)
  • Revision ID: paul@canonical.com-20090331222414-s0uvie5qiv3nkomv
Cleaned up the config for loggerhead

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')