From 8a0654abe2db919b04683d40100b469e8c3adc4b Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Mon, 3 Sep 2007 17:04:41 -0700 Subject: Refactor command line utilities to share setup. Hide internal gitosis-ssh and gitosis-gitweb, it's all in gitosis-run-hook. --- gitosis/gitweb.py | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'gitosis/gitweb.py') diff --git a/gitosis/gitweb.py b/gitosis/gitweb.py index 69f6c7d..1682a05 100644 --- a/gitosis/gitweb.py +++ b/gitosis/gitweb.py @@ -27,7 +27,7 @@ To plug this into ``gitweb``, you have two choices. import os, urllib, logging -from ConfigParser import RawConfigParser, NoSectionError, NoOptionError +from ConfigParser import NoSectionError, NoOptionError from gitosis import util @@ -113,31 +113,3 @@ def generate(config, path): f.close() os.rename(tmp, path) - -def _getParser(): - import optparse - parser = optparse.OptionParser( - usage="%prog [--config=FILE] PROJECTSLIST") - parser.set_defaults( - config=os.path.expanduser('~/.gitosis.conf'), - ) - parser.add_option('--config', - metavar='FILE', - help='read config from FILE (default %s)' - % parser.defaults['config'], - ) - return parser - -def main(): - parser = _getParser() - (options, args) = parser.parse_args() - - if len(args) != 1: - parser.error('Expected one command line argument.') - - path, = args - - cfg = RawConfigParser() - cfg.read(options.config) - - generate(config=cfg, path=path) -- cgit v1.2.3