summaryrefslogtreecommitdiffstats
path: root/g2h/page_factory.py
blob: 43a48ae014a68325c6f244dad19cd2893774d866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from .commit_page import CommitPage
from .overview_page import OverviewPage
from .log_page import LogPage

class PageFactory:
    def __init__(self, out_dir, name, content_subdir):
        self.out_dir = out_dir
        self.name = name
        self.content_subdir = content_subdir

    def new_commit(self, commit):
        return CommitPage(self.out_dir, self.name, commit, self.content_subdir)

    def new_overview(self, branches, tags):
        return OverviewPage(self.out_dir, self.name, branches, tags, self.content_subdir)

    def new_log(self, commits, branches, tags):
        return LogPage(self.out_dir, self.name, commits, branches, tags, self.content_subdir)