summaryrefslogtreecommitdiffstats
path: root/g2h/page_factory.py
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2025-09-19 19:21:11 +0200
committerChristoph Schlosser <christoph@linux.com>2025-09-19 19:21:11 +0200
commita3324b7e71ec48daab81981e7d85967a590d4f79 (patch)
treedef4a8d901d9a56047a0e63f5f3d93803c93ee87 /g2h/page_factory.py
parentbd403e6ab18d5cc7818e86d43c3ca0b15c5e53a1 (diff)
downloadgit2hugo-a3324b7e71ec48daab81981e7d85967a590d4f79.tar.gz
g2h: Add utility script
Also move the sources into the more conventional src/g2h dir
Diffstat (limited to 'g2h/page_factory.py')
-rw-r--r--g2h/page_factory.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/g2h/page_factory.py b/g2h/page_factory.py
deleted file mode 100644
index 4a46f14..0000000
--- a/g2h/page_factory.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import os
-
-from .commit_page import CommitPage
-from .file_page import FilePage
-from .overview_page import OverviewPage
-from .log_page import LogPage
-from .tree_page import TreePage
-
-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_file(self, commit, path):
- filename = os.path.basename(path)
- dir = os.path.dirname(path)
- return FilePage(self.out_dir, self.name, commit, filename, dir, self.content_subdir)
-
- def new_overview(self, branches, tags, head):
- return OverviewPage(self.out_dir, self.name, branches, tags, self.content_subdir, head)
-
- def new_log(self, commits, branches, tags, head):
- return LogPage(self.out_dir, self.name, commits, branches, tags, self.content_subdir, head)
-
- def new_tree(self, commit, tree_segment, repo):
- return TreePage(self.out_dir, self.name, commit, tree_segment, repo, self.content_subdir)