Mercurial > wikked
changeset 287:3eef607e62d4
Orphans are only looked for in the default enpoint (normal pages).
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 27 Sep 2014 14:07:24 -0700 |
parents | c0508545f8e5 |
children | 9889c18b914f |
files | wikked/views/special.py wikked/wiki.py |
diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/wikked/views/special.py Sat Sep 27 14:06:45 2014 -0700 +++ b/wikked/views/special.py Sat Sep 27 14:07:24 2014 -0700 @@ -6,7 +6,7 @@ @app.route('/api/orphans') def api_special_orphans(): orphans = [] - for page in g.wiki.getPages(): + for page in g.wiki.getPages(no_endpoint_only=True): try: if not is_page_readable(page): continue
--- a/wikked/wiki.py Sat Sep 27 14:06:45 2014 -0700 +++ b/wikked/wiki.py Sat Sep 27 14:07:24 2014 -0700 @@ -199,8 +199,8 @@ '/' + parameters.config.get('wiki', 'main_page').strip('/')) self.templates_url = ( - '/' + - parameters.config.get('wiki', 'templates_dir').strip('/') + '/') + parameters.config.get('wiki', 'templates_endpoint') + + ':/') self.endpoints = self._createEndpointInfos(parameters.config) self.fs = parameters.fs_factory() @@ -310,10 +310,12 @@ for url in self.db.getPageUrls(subdir): yield url - def getPages(self, subdir=None, meta_query=None, fields=None): + def getPages(self, subdir=None, meta_query=None, + endpoint_only=None, no_endpoint_only=False, fields=None): """ Gets all the pages in the wiki, or in the given sub-directory. """ for page in self.db.getPages(subdir=subdir, meta_query=meta_query, + endpoint_only=endpoint_only, no_endpoint_only=no_endpoint_only, fields=fields): yield page