Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create a function forchmod operations#291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AA-Turner merged 1 commit intomainfromchmod
Apr 15, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletionsbuild_docs.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,6 +54,7 @@
import re
import shlex
import shutil
import stat
import subprocess
import sys
import venv
Expand DownExpand Up@@ -744,18 +745,7 @@
group=self.group,
recursive=True,
)
run(["chmod", "-R", "o+r", self.checkout / "Doc" / "build" / "html"])
run([
"find",
self.checkout / "Doc" / "build" / "html",
"-type",
"d",
"-exec",
"chmod",
"o+x",
"{}",
";",
])
chmod_make_readable(self.checkout / "Doc" / "build" / "html")

Check warning on line 748 in build_docs.py

View check run for this annotation

Codecov/ codecov/patch

build_docs.py#L748

Added line #L748 was not covered by tests
run([
"rsync",
"-a",
Expand All@@ -770,12 +760,7 @@
# Copy archive files to /archives/
logging.debug("Copying dist files.")
chgrp(self.checkout / "Doc" / "dist", group=self.group, recursive=True)
run([
"chmod",
"-R",
"o+r",
self.checkout / "Doc" / "dist",
])
chmod_make_readable(self.checkout / "Doc" / "dist")

Check warning on line 763 in build_docs.py

View check run for this annotation

Codecov/ codecov/patch

build_docs.py#L763

Added line #L763 was not covered by tests
run(["mkdir", "-m", "o+rx", "-p", target / "archives"])
chgrp(target / "archives", group=self.group)
run([
Expand DownExpand Up@@ -907,6 +892,18 @@
logging.warning("Can't change group of %s: %s", path, str(err))


def chmod_make_readable(path: Path, /, mode: int = stat.S_IROTH) -> None:
if not path.is_dir():
raise ValueError

Check warning on line 897 in build_docs.py

View check run for this annotation

Codecov/ codecov/patch

build_docs.py#L896-L897

Added lines #L896 - L897 were not covered by tests

path.chmod(path.stat().st_mode | stat.S_IROTH | stat.S_IXOTH) # o+rx
for p in path.rglob("*"):
if p.is_dir():
p.chmod(p.stat().st_mode | stat.S_IROTH | stat.S_IXOTH) # o+rx

Check warning on line 902 in build_docs.py

View check run for this annotation

Codecov/ codecov/patch

build_docs.py#L899-L902

Added lines #L899 - L902 were not covered by tests
else:
p.chmod(p.stat().st_mode | stat.S_IROTH) # o+r

Check warning on line 904 in build_docs.py

View check run for this annotation

Codecov/ codecov/patch

build_docs.py#L904

Added line #L904 was not covered by tests


def format_seconds(seconds: float) -> str:
hours, remainder = divmod(seconds, 3600)
minutes, seconds = divmod(remainder, 60)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp