Give meaningful name to gitweb projects.list generation.
Remove mentions of cancelled gitweb.conf generation from docstrings.
This commit is contained in:
parent
a30645db52
commit
5bd5bd5bfc
|
@ -37,9 +37,9 @@ def _escape_filename(s):
|
||||||
s = s.replace('"', '\\"')
|
s = s.replace('"', '\\"')
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def generate_fp(config, fp):
|
def generate_project_list_fp(config, fp):
|
||||||
"""
|
"""
|
||||||
Generate a config file and projects list for ``gitweb``.
|
Generate projects list for ``gitweb``.
|
||||||
|
|
||||||
:param config: configuration to read projects from
|
:param config: configuration to read projects from
|
||||||
:type config: RawConfigParser
|
:type config: RawConfigParser
|
||||||
|
@ -94,9 +94,9 @@ def generate_fp(config, fp):
|
||||||
line = ' '.join([urllib.quote_plus(s) for s in response])
|
line = ' '.join([urllib.quote_plus(s) for s in response])
|
||||||
print >>fp, line
|
print >>fp, line
|
||||||
|
|
||||||
def generate(config, path):
|
def generate_project_list(config, path):
|
||||||
"""
|
"""
|
||||||
Generate a config file and projects list for ``gitweb``.
|
Generate projects list for ``gitweb``.
|
||||||
|
|
||||||
:param config: configuration to read projects from
|
:param config: configuration to read projects from
|
||||||
:type config: RawConfigParser
|
:type config: RawConfigParser
|
||||||
|
|
|
@ -27,7 +27,7 @@ def post_update(cfg, git_dir):
|
||||||
os.path.join(export, 'gitosis.conf'),
|
os.path.join(export, 'gitosis.conf'),
|
||||||
os.path.join(export, '..', 'gitosis.conf'),
|
os.path.join(export, '..', 'gitosis.conf'),
|
||||||
)
|
)
|
||||||
gitweb.generate(
|
gitweb.generate_project_list(
|
||||||
config=cfg,
|
config=cfg,
|
||||||
path=os.path.join(git_dir, 'projects.list'),
|
path=os.path.join(git_dir, 'projects.list'),
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,7 +10,7 @@ from gitosis.test.util import mkdir, maketemp
|
||||||
def test_projectsList_empty():
|
def test_projectsList_empty():
|
||||||
cfg = RawConfigParser()
|
cfg = RawConfigParser()
|
||||||
got = StringIO()
|
got = StringIO()
|
||||||
gitweb.generate_fp(
|
gitweb.generate_project_list_fp(
|
||||||
config=cfg,
|
config=cfg,
|
||||||
fp=got)
|
fp=got)
|
||||||
eq(got.getvalue(), '''\
|
eq(got.getvalue(), '''\
|
||||||
|
@ -20,7 +20,7 @@ def test_projectsList_repoDenied():
|
||||||
cfg = RawConfigParser()
|
cfg = RawConfigParser()
|
||||||
cfg.add_section('repo foo/bar')
|
cfg.add_section('repo foo/bar')
|
||||||
got = StringIO()
|
got = StringIO()
|
||||||
gitweb.generate_fp(
|
gitweb.generate_project_list_fp(
|
||||||
config=cfg,
|
config=cfg,
|
||||||
fp=got)
|
fp=got)
|
||||||
eq(got.getvalue(), '''\
|
eq(got.getvalue(), '''\
|
||||||
|
@ -31,7 +31,7 @@ def test_projectsList_noOwner():
|
||||||
cfg.add_section('repo foo/bar')
|
cfg.add_section('repo foo/bar')
|
||||||
cfg.set('repo foo/bar', 'gitweb', 'yes')
|
cfg.set('repo foo/bar', 'gitweb', 'yes')
|
||||||
got = StringIO()
|
got = StringIO()
|
||||||
gitweb.generate_fp(
|
gitweb.generate_project_list_fp(
|
||||||
config=cfg,
|
config=cfg,
|
||||||
fp=got)
|
fp=got)
|
||||||
eq(got.getvalue(), '''\
|
eq(got.getvalue(), '''\
|
||||||
|
@ -44,7 +44,7 @@ def test_projectsList_haveOwner():
|
||||||
cfg.set('repo foo/bar', 'gitweb', 'yes')
|
cfg.set('repo foo/bar', 'gitweb', 'yes')
|
||||||
cfg.set('repo foo/bar', 'owner', 'John Doe')
|
cfg.set('repo foo/bar', 'owner', 'John Doe')
|
||||||
got = StringIO()
|
got = StringIO()
|
||||||
gitweb.generate_fp(
|
gitweb.generate_project_list_fp(
|
||||||
config=cfg,
|
config=cfg,
|
||||||
fp=got)
|
fp=got)
|
||||||
eq(got.getvalue(), '''\
|
eq(got.getvalue(), '''\
|
||||||
|
@ -60,7 +60,7 @@ def test_projectsList_multiple():
|
||||||
cfg.add_section('repo quux')
|
cfg.add_section('repo quux')
|
||||||
cfg.set('repo quux', 'gitweb', 'yes')
|
cfg.set('repo quux', 'gitweb', 'yes')
|
||||||
got = StringIO()
|
got = StringIO()
|
||||||
gitweb.generate_fp(
|
gitweb.generate_project_list_fp(
|
||||||
config=cfg,
|
config=cfg,
|
||||||
fp=got)
|
fp=got)
|
||||||
eq(got.getvalue(), '''\
|
eq(got.getvalue(), '''\
|
||||||
|
@ -81,7 +81,7 @@ def test_projectsList_multiple_globalGitwebYes():
|
||||||
# this is still hidden
|
# this is still hidden
|
||||||
cfg.set('repo thud', 'gitweb', 'no')
|
cfg.set('repo thud', 'gitweb', 'no')
|
||||||
got = StringIO()
|
got = StringIO()
|
||||||
gitweb.generate_fp(
|
gitweb.generate_project_list_fp(
|
||||||
config=cfg,
|
config=cfg,
|
||||||
fp=got)
|
fp=got)
|
||||||
eq(got.getvalue(), '''\
|
eq(got.getvalue(), '''\
|
||||||
|
@ -99,7 +99,7 @@ def test_projectsList_reallyEndsWithGit():
|
||||||
cfg.add_section('repo foo')
|
cfg.add_section('repo foo')
|
||||||
cfg.set('repo foo', 'gitweb', 'yes')
|
cfg.set('repo foo', 'gitweb', 'yes')
|
||||||
got = StringIO()
|
got = StringIO()
|
||||||
gitweb.generate_fp(
|
gitweb.generate_project_list_fp(
|
||||||
config=cfg,
|
config=cfg,
|
||||||
fp=got)
|
fp=got)
|
||||||
eq(got.getvalue(), '''\
|
eq(got.getvalue(), '''\
|
||||||
|
|
Loading…
Reference in a new issue