Skip to content

Commit

Permalink
oopses
Browse files Browse the repository at this point in the history
  • Loading branch information
staffanm committed Nov 22, 2018
1 parent 6bfa030 commit c9442af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ferenda/devel.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _render(self, title, body, uri, config, template="xsl/generic.xsl"):
resourceloader=repo.resourceloader,
config=conffile)
urltransform = None
if repo.config.develurl:
if 'develurl' in repo.config and repo.config.develurl:
urltransform = repo.get_url_transform_func(develurl=repo.config.develurl)
depth = len(doc.uri.split("/")) - 3
tree = transformer.transform(xhtml, depth,
Expand Down
6 changes: 6 additions & 0 deletions ferenda/documentrepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ def get_default_options(cls):
'downloadmax': nativeint,
'conditionalget': True,
'url': 'http://localhost:8000/',
'develurl': None,
'fulltextindex': True,
'useragent': 'ferenda-bot',
'relate': True,
Expand Down Expand Up @@ -2471,6 +2472,11 @@ def get_url_transform_func(self, repos=None, basedir=None,
def getpath(url, repos, methodname="generated_path"):
if methodname == "generated_path" and url == self.config.url:
return self.config.datadir + os.sep + "index.html"
if "/" not in url:
# this is definitly not a HTTP(S) url, might be a
# mailto:? Anyway, we won't get a usable path from it
# so don't bother.
return None
for (repoidx, repo) in enumerate(repos):
# FIXME: This works less than optimal when using
# CompositeRepository -- the problem is that a subrepo
Expand Down

0 comments on commit c9442af

Please sign in to comment.