Skip to content

Commit

Permalink
maybe this time?
Browse files Browse the repository at this point in the history
  • Loading branch information
staffanm committed Jul 9, 2014
1 parent 85fbe6d commit 8862551
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions doc/createdocrepos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ etc used by :meth:`~ferenda.DocumentRepository.generate`.

The default implementation is generic enough to handle most cases, but
you'll have to override other methods which it calls, primarily
:meth:`~ferenda.DocumentRepository.facets`,
:meth:`~ferenda.DocumentRepository.toc_items`. These methods all
:meth:`~ferenda.DocumentRepository.facets` and
:meth:`~ferenda.DocumentRepository.toc_items`. These methods
depend on the metadata you've created by your parse implementation,
but in the simplest cases it's enough to specify that you want one set
of pages organized by the ``dcterms:title`` of each document
Expand Down
24 changes: 13 additions & 11 deletions ferenda/documentrepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -2044,17 +2044,16 @@ def generated_url(self, basefile):
#

def toc(self, otherrepos=[]):
"""Creates a set of pages that together acts as a table of
contents for all documents in the repository. For smaller
repositories a single page might be enough, but for
repositoriees with a few hundred documents or more, there will
usually be one page for all documents starting with A,
starting with B, and so on. There might be different ways of
browseing/drilling down, i.e. both by title, publication year,
keyword and so on.
"""Creates a set of pages that together acts as a table of contents
for all documents in the repository. For smaller repositories
a single page might be enough, but for repositoriees with a
few hundred documents or more, there will usually be one page
for all documents starting with A, starting with B, and so
on. There might be different ways of browseing/drilling down,
i.e. both by title, publication year, keyword and so on.
The default implementation calls
:py:meth:`~ferenda.DocumentRepository.toc_select` to get all
:py:meth:`~ferenda.DocumentRepository.faceted_data` to get all
data from the triple store,
:py:meth:`~ferenda.DocumentRepository.facets` to find
out the facets for ordering,
Expand All @@ -2069,8 +2068,11 @@ def toc(self, otherrepos=[]):
``dcterms:issued`` property).
You can override any of these methods to customize any part of
the toc generation process. Often overriding :py:meth:`~ferenda.DocumentRepository.facets` to
specify other document properties will be sufficient."""
the toc generation process. Often overriding
:py:meth:`~ferenda.DocumentRepository.facets` to specify other
document properties will be sufficient.
"""

params = {}
with util.logtime(self.log.debug,
Expand Down
1 change: 0 additions & 1 deletion ferenda/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ def _enabled_classes(inifile=None):
>>> enable("ferenda.DocumentRepository") == 'base'
True
>>> _enabled_classes()
>>> _enabled_classes() == {'base': 'ferenda.DocumentRepository'}
True
>>> os.unlink("ferenda.ini")
Expand Down
4 changes: 3 additions & 1 deletion test/testManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,9 @@ def callstore(self):

def tearDown(self):
manager.shutdown_logger()
if not 'TRAVIS' in os.environ:
if 'TRAVIS' in os.environ:
util.robust_remove("ferenda.ini")
else:
os.chdir(self.orig_cwd)
shutil.rmtree(self.tempdir)
sys.path.remove(self.tempdir)
Expand Down

0 comments on commit 8862551

Please sign in to comment.