From 8862551aa2d084b8acea2dcb271d5e240a855d04 Mon Sep 17 00:00:00 2001 From: Staffan Malmgren Date: Wed, 9 Jul 2014 06:08:45 +0200 Subject: [PATCH] maybe this time? --- doc/createdocrepos.rst | 4 ++-- ferenda/documentrepository.py | 24 +++++++++++++----------- ferenda/manager.py | 1 - test/testManager.py | 4 +++- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/doc/createdocrepos.rst b/doc/createdocrepos.rst index 29bbcc6d..bc1cc35d 100644 --- a/doc/createdocrepos.rst +++ b/doc/createdocrepos.rst @@ -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 diff --git a/ferenda/documentrepository.py b/ferenda/documentrepository.py index 1256bd1c..087af70e 100644 --- a/ferenda/documentrepository.py +++ b/ferenda/documentrepository.py @@ -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, @@ -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, diff --git a/ferenda/manager.py b/ferenda/manager.py index e91b4877..b0ab3c40 100644 --- a/ferenda/manager.py +++ b/ferenda/manager.py @@ -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") diff --git a/test/testManager.py b/test/testManager.py index c3923adc..eac96a6c 100644 --- a/test/testManager.py +++ b/test/testManager.py @@ -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)