diff options
author | Tommi Virtanen <tv@eagain.net> | 2007-09-03 17:04:41 -0700 |
---|---|---|
committer | Tommi Virtanen <tv@eagain.net> | 2007-09-03 17:09:12 -0700 |
commit | 8a0654abe2db919b04683d40100b469e8c3adc4b (patch) | |
tree | 57903f32603cc57bd894c62ec2a0fa87d0985e15 /gitosis/gitweb.py | |
parent | Make setuptools include templates in the egg. (diff) | |
download | gitosis-dakkar-8a0654abe2db919b04683d40100b469e8c3adc4b.tar.gz gitosis-dakkar-8a0654abe2db919b04683d40100b469e8c3adc4b.tar.bz2 gitosis-dakkar-8a0654abe2db919b04683d40100b469e8c3adc4b.zip |
Refactor command line utilities to share setup.
Hide internal gitosis-ssh and gitosis-gitweb, it's all in gitosis-run-hook.
Diffstat (limited to 'gitosis/gitweb.py')
-rw-r--r-- | gitosis/gitweb.py | 30 |
1 files changed, 1 insertions, 29 deletions
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) |