mkdocs-document-dates 1.9.2__tar.gz → 1.9.3__tar.gz
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-1.9.2 → mkdocs_document_dates-1.9.3}/PKG-INFO +1 -1
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates.egg-info/PKG-INFO +1 -1
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/setup.py +37 -30
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/LICENSE +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/README.md +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/__init__.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/hooks/pre-commit +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/__init__.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/ar.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/de.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/en.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/es.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/fr.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/ja.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/ko.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/ru.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/zh.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/zh_tw.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/plugin.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/styles.py +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates.egg-info/SOURCES.txt +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates.egg-info/dependency_links.txt +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates.egg-info/entry_points.txt +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates.egg-info/requires.txt +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates.egg-info/top_level.txt +0 -0
- {mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/setup.cfg +0 -0
@@ -9,38 +9,45 @@ from pathlib import Path
|
|
9
9
|
|
10
10
|
def install_git_hooks():
|
11
11
|
try:
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
12
|
+
# 创建一个安装脚本
|
13
|
+
install_script = """
|
14
|
+
#!/usr/bin/env python3
|
15
|
+
import site
|
16
|
+
import os
|
17
|
+
from pathlib import Path
|
18
|
+
|
19
|
+
def setup_hooks():
|
20
|
+
# 查找 hooks 目录
|
21
|
+
for site_dir in site.getsitepackages():
|
22
|
+
hooks_dir = Path(site_dir) / 'mkdocs_document_dates' / 'hooks'
|
23
|
+
if hooks_dir.exists():
|
24
|
+
hook_path = hooks_dir / 'pre-commit'
|
25
|
+
if hook_path.exists():
|
26
|
+
# 设置权限
|
27
|
+
if os.name != 'nt':
|
28
|
+
os.chmod(hooks_dir, 0o755)
|
29
|
+
os.chmod(hook_path, 0o755)
|
30
|
+
# 设置 git hooks 路径
|
31
|
+
os.system(f'git config --global core.hooksPath "{hooks_dir}"')
|
32
|
+
print(f"Git hooks installed at: {hooks_dir}")
|
26
33
|
return
|
34
|
+
print("Warning: Hooks directory not found")
|
35
|
+
|
36
|
+
if __name__ == "__main__":
|
37
|
+
setup_hooks()
|
38
|
+
"""
|
39
|
+
# 创建安装脚本
|
40
|
+
script_dir = Path.home() / '.mkdocs_document_dates'
|
41
|
+
script_dir.mkdir(exist_ok=True)
|
42
|
+
script_path = script_dir / 'setup_hooks.py'
|
43
|
+
script_path.write_text(install_script)
|
27
44
|
|
28
|
-
#
|
29
|
-
|
30
|
-
|
31
|
-
print("Warning: pre-commit hook not found")
|
32
|
-
return
|
33
|
-
|
34
|
-
# 使用 os.chmod 代替 chmod 命令
|
35
|
-
if os.name != 'nt': # 非 Windows 系统才设置权限
|
36
|
-
os.chmod(hooks_dir, 0o755)
|
37
|
-
os.chmod(hook_path, 0o755)
|
38
|
-
|
39
|
-
# 设置全局 hooks 路径(git 命令在所有平台都一样)
|
40
|
-
subprocess.run(['git', 'config', '--global', 'core.hooksPath', str(hooks_dir)],
|
41
|
-
check=True)
|
45
|
+
# 设置脚本权限
|
46
|
+
if os.name != 'nt':
|
47
|
+
os.chmod(script_path, 0o755)
|
42
48
|
|
43
|
-
|
49
|
+
# 执行脚本
|
50
|
+
subprocess.run([sys.executable, str(script_path)], check=True)
|
44
51
|
|
45
52
|
except Exception as e:
|
46
53
|
print(f"Warning: Failed to install git hooks: {e}")
|
@@ -66,7 +73,7 @@ try:
|
|
66
73
|
except FileNotFoundError:
|
67
74
|
long_description = "A MkDocs plugin for displaying accurate document creation and last modification dates."
|
68
75
|
|
69
|
-
VERSION = '1.9.
|
76
|
+
VERSION = '1.9.3'
|
70
77
|
|
71
78
|
setup(
|
72
79
|
name="mkdocs-document-dates",
|
File without changes
|
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/__init__.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/hooks/pre-commit
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/__init__.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/ar.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/de.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/en.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/es.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/fr.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/ja.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/ko.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/ru.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/zh.py
RENAMED
File without changes
|
{mkdocs_document_dates-1.9.2 → mkdocs_document_dates-1.9.3}/mkdocs_document_dates/lang/zh_tw.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|