~dholbach/developer-ubuntu-com/add-toc-md-ext

« back to all changes in this revision

Viewing changes to md_importer/importer/repo.py

Importer: let index_page adhere to same in_navigation settings as the import directive

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
        self.post_checkout_command = post_checkout_command
34
34
        self.branch_nick = os.path.basename(self.origin.replace('.git', ''))
35
35
        self.checkout_location = os.path.join(tempdir, self.branch_nick)
36
 
        self.article_class = Article
37
36
 
38
37
    def get(self):
39
38
        sourcecode = SourceCode(self.origin, self.checkout_location,
92
91
                try:
93
92
                    self.index_page = IndexPage(
94
93
                        title=self.branch_nick, full_url=directive['write_to'],
95
 
                        in_navigation=True, html='', menu_title=None,
96
 
                        template=DEFAULT_TEMPLATE)
 
94
                        in_navigation=directive['advertise'], html='',
 
95
                        menu_title=None, template=DEFAULT_TEMPLATE)
97
96
                    self.pages.extend([self.index_page.page])
98
97
                except ParentNotFoundException:
99
98
                    return self._abort_import(
123
122
        return False
124
123
 
125
124
    def _read_article(self, fn, write_to, advertise, template):
126
 
        article = self.article_class(fn, write_to, advertise, template)
 
125
        article = Article(fn, write_to, advertise, template)
127
126
        if article.read():
128
127
            return article
129
128
        return None