-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix directories for suggested use pattern
- Loading branch information
Showing
1 changed file
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,8 @@ | |
.. code-block:: bash | ||
$ scp "[email protected]:/var/log/docsbuild/docsbuild.log*" docsbuild-logs | ||
$ mkdir -p docsbuild-logs | ||
$ scp "[email protected]:/var/log/docsbuild/docsbuild.log*" docsbuild-logs/ | ||
$ python check_times.py | ||
""" | ||
|
||
|
@@ -15,15 +16,17 @@ | |
|
||
from build_docs import format_seconds | ||
|
||
LOGS_ROOT = Path('docsbuild-logs').resolve() | ||
|
||
|
||
def get_lines() -> list[str]: | ||
lines = [] | ||
zipped_logs = list(Path.cwd().glob("docsbuild.log.*.gz")) | ||
zipped_logs = list(LOGS_ROOT.glob("docsbuild.log.*.gz")) | ||
zipped_logs.sort(key=lambda p: int(p.name.split(".")[-2]), reverse=True) | ||
for logfile in zipped_logs: | ||
with gzip.open(logfile, "rt", encoding="utf-8") as f: | ||
lines += f.readlines() | ||
with open("docsbuild.log", encoding="utf-8") as f: | ||
with open(LOGS_ROOT / "docsbuild.log", encoding="utf-8") as f: | ||
lines += f.readlines() | ||
return lines | ||
|
||
|