Skip to content

Commit

Permalink
more debug code and change os.link() arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
buhtz committed Dec 28, 2023
1 parent 7703f8e commit 2e7611d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pydoctor/templatewriter/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ def writeSummaryPages(self, system: model.System) -> None:

# When support for Python 3.9 and older is dropped use
# pathlib.Path.hardlink_to() instead.
print(Path.cwd())
os.link(root_module_path.parent / 'index.html', root_module_path)
x = list(root_module_path.parent.glob('*'))
print(f'TTTT\n{root_module_path=} {x=}')
print(f'{root_module_path.exists()=}')
os.link(
src=root_module_path, # original
dst=root_module_path.parent / 'index.html' # the hardlink
)

def _writeDocsFor(self, ob: model.Documentable) -> None:
if not ob.isVisible:
Expand Down
3 changes: 3 additions & 0 deletions pydoctor/test/test_commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ def test_main_symlinked_paths(tmp_path: Path) -> None:
link = tmp_path / 'src'
link.symlink_to(Path.cwd(), target_is_directory=True)

print(f'{link=} {link.exists()=}')
print(f'{Path.cwd()=} {Path.cwd().exists()=}')

exit_code = driver.main(args=[
'--project-base-dir=.',
'--html-viewsource-base=http://example.com',
Expand Down

0 comments on commit 2e7611d

Please sign in to comment.