mkdocs-document-dates 1.9.0__py3-none-any.whl → 1.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mkdocs_document_dates/hooks/pre-commit +20 -6
- {mkdocs_document_dates-1.9.0.dist-info → mkdocs_document_dates-1.9.1.dist-info}/METADATA +1 -1
- {mkdocs_document_dates-1.9.0.dist-info → mkdocs_document_dates-1.9.1.dist-info}/RECORD +7 -7
- {mkdocs_document_dates-1.9.0.dist-info → mkdocs_document_dates-1.9.1.dist-info}/LICENSE +0 -0
- {mkdocs_document_dates-1.9.0.dist-info → mkdocs_document_dates-1.9.1.dist-info}/WHEEL +0 -0
- {mkdocs_document_dates-1.9.0.dist-info → mkdocs_document_dates-1.9.1.dist-info}/entry_points.txt +0 -0
- {mkdocs_document_dates-1.9.0.dist-info → mkdocs_document_dates-1.9.1.dist-info}/top_level.txt +0 -0
@@ -1,13 +1,28 @@
|
|
1
1
|
#!/usr/bin/env python3
|
2
|
+
|
2
3
|
import os
|
3
4
|
import sys
|
4
5
|
import json
|
5
6
|
import platform
|
6
7
|
import subprocess
|
7
|
-
import logging
|
8
8
|
from datetime import datetime
|
9
9
|
from pathlib import Path
|
10
10
|
|
11
|
+
# 添加调试日志到项目的 docs 目录
|
12
|
+
def log_debug(message):
|
13
|
+
try:
|
14
|
+
git_root = Path(subprocess.check_output(
|
15
|
+
['git', 'rev-parse', '--show-toplevel'],
|
16
|
+
text=True
|
17
|
+
).strip())
|
18
|
+
|
19
|
+
docs_dir = git_root / 'docs'
|
20
|
+
if docs_dir.exists():
|
21
|
+
with open(docs_dir / '.hook_debug.log', 'a') as f:
|
22
|
+
f.write(f"{datetime.now()}: {message}\n")
|
23
|
+
except:
|
24
|
+
pass # 静默失败,不影响主流程
|
25
|
+
|
11
26
|
# 配置日志
|
12
27
|
def setup_logging():
|
13
28
|
"""设置日志"""
|
@@ -38,12 +53,11 @@ def setup_logging():
|
|
38
53
|
|
39
54
|
if __name__ == "__main__":
|
40
55
|
try:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
logging.info("Pre-commit hook completed successfully")
|
56
|
+
log_debug("Hook started")
|
57
|
+
update_dates_cache()
|
58
|
+
log_debug("Hook completed")
|
45
59
|
except Exception as e:
|
46
|
-
|
60
|
+
log_debug(f"Hook error: {e}")
|
47
61
|
sys.exit(1)
|
48
62
|
|
49
63
|
def find_mkdocs_projects():
|
@@ -1,7 +1,7 @@
|
|
1
1
|
mkdocs_document_dates/__init__.py,sha256=CZ37u8DC6kbkupKFk-VKyfKZZFAJ4rOD0aPzOzVoATc,58
|
2
2
|
mkdocs_document_dates/plugin.py,sha256=zgZ9QrbfsMDAv80P11I_99urSvFolJq93Ow7P-pfS_A,9753
|
3
3
|
mkdocs_document_dates/styles.py,sha256=ujhlKgDWsOo5sHiYtf3XekuGg4C5Yjol8RzP3W9Wzjo,578
|
4
|
-
mkdocs_document_dates/hooks/pre-commit,sha256=
|
4
|
+
mkdocs_document_dates/hooks/pre-commit,sha256=22kOemtPRUflmAWyELUTzH7F8IWxJXkujqzPzSIlS_M,4289
|
5
5
|
mkdocs_document_dates/lang/__init__.py,sha256=M1BLjCOA3HHKeAitk45YAgzxxNpnxFUvVAk6-FO_QSA,690
|
6
6
|
mkdocs_document_dates/lang/ar.py,sha256=BsZlxz54U_spOZ5SBiKt73ywoLKbR54cZNkKAs86OxM,632
|
7
7
|
mkdocs_document_dates/lang/de.py,sha256=B0Ffrn4lVSvcxFpGho7SiMm16GXYEmpjcVAR-k4UgSI,585
|
@@ -13,9 +13,9 @@ mkdocs_document_dates/lang/ko.py,sha256=GwY6yrKYAOj6S6feq9yqNxr2XpyGHC0XeenO541v
|
|
13
13
|
mkdocs_document_dates/lang/ru.py,sha256=fK5s4mQKCoP6KI3jf6eqqmqB3YVn39q81U7Cw1QWNNg,721
|
14
14
|
mkdocs_document_dates/lang/zh.py,sha256=OrLElrSTZhHSwxBzuUtUj7NpQb7wm0s83viimpk2ynM,519
|
15
15
|
mkdocs_document_dates/lang/zh_tw.py,sha256=t3qu-a7UOzgcmYDkLFiosJZCcpfMU4xiKTJfu1ZHoHA,519
|
16
|
-
mkdocs_document_dates-1.9.
|
17
|
-
mkdocs_document_dates-1.9.
|
18
|
-
mkdocs_document_dates-1.9.
|
19
|
-
mkdocs_document_dates-1.9.
|
20
|
-
mkdocs_document_dates-1.9.
|
21
|
-
mkdocs_document_dates-1.9.
|
16
|
+
mkdocs_document_dates-1.9.1.dist-info/LICENSE,sha256=1YKfCs5WKSk-bON8a68WZE5to1B2klCrHBYiuaVCThM,514
|
17
|
+
mkdocs_document_dates-1.9.1.dist-info/METADATA,sha256=xcqZAgxXjObVB9G_6Sbbe3uNFnilsWfmVEDqGHf2dw0,3908
|
18
|
+
mkdocs_document_dates-1.9.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
19
|
+
mkdocs_document_dates-1.9.1.dist-info/entry_points.txt,sha256=gI-OFLGjDG6-oLEfyevl3Gwwj2GcqVFQeX3bvL1IF8o,83
|
20
|
+
mkdocs_document_dates-1.9.1.dist-info/top_level.txt,sha256=yWkKQdNuAJJVqUQ9uLa5xD4x_Gux4IfOUpy8Ryagdwc,22
|
21
|
+
mkdocs_document_dates-1.9.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{mkdocs_document_dates-1.9.0.dist-info → mkdocs_document_dates-1.9.1.dist-info}/entry_points.txt
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.0.dist-info → mkdocs_document_dates-1.9.1.dist-info}/top_level.txt
RENAMED
File without changes
|