Skip to content

Commit 1bf2d66

Browse files
committed
Update
1 parent bdcbabc commit 1bf2d66

4 files changed

Lines changed: 49 additions & 22 deletions

File tree

file/ptools/main.py

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,59 @@
1010
import logging
1111
import os
1212

13-
__version__ = "Beta 0.1"
13+
__version__: str = "Beta 0.1"
1414

1515

1616
def main() -> int:
17-
console = Console()
18-
panel = Panel(Text("Welcome to the Python Tools application!",
19-
justify="center"),
20-
title="PTools", subtitle="Enjoy your using!",
21-
style="bold green")
17+
console: Console = Console()
18+
panel: Panel = Panel(
19+
Text("Welcome to the Python Tools application!", justify="center"),
20+
title="PTools",
21+
subtitle="Enjoy your using!",
22+
style="bold green",
23+
)
2224
console.print(panel)
23-
logging.basicConfig(level=logging.DEBUG, format="%(message)s",
24-
handlers=[RichHandler()])
25+
logging.basicConfig(
26+
level=logging.DEBUG, format="%(message)s", handlers=[RichHandler()]
27+
)
2528
logging.info("Starting main process.")
2629
logging.debug(f"Platform: {platform.platform()}")
2730
logging.debug(f"Python version: {platform.python_version()}")
2831
logging.debug(f"markdown module version: {markdown.__version__}")
2932
logging.debug(f"rich module version: {importlib.metadata.version('rich')}")
3033
logging.debug(f"PTools module version: {__version__}")
31-
paths = console.input("Input your markdown file [bold]path[/bold] "
32-
'("|" to split): ')
33-
paths = paths.split("|")
34-
logging.debug(f"Input paths: {paths}")
34+
input_paths: set[str] = set(console.input(
35+
"Input your markdown file [bold]path[/bold] " '("|" to split): '
36+
).split("|"))
37+
logging.debug(f"Input paths: {input_paths}")
3538
# Does the file exist? Is it a file?
36-
vpaths = []
37-
for path in paths:
39+
vinput_paths: list[str] = []
40+
for path in input_paths:
3841
if not os.path.exists(path):
3942
logging.warning(f"File not found: {path}")
4043
elif not os.path.isfile(path):
4144
logging.warning(f"Path is not a file: {path}")
45+
elif not (path.endswith(".md") or path.endswith(".markdown")):
46+
logging.warning(f"Path is not a markdown file: {path}")
4247
else:
43-
vpaths.append(path)
44-
logging.debug(f"Valid paths: {vpaths}")
48+
vinput_paths.append(path)
49+
logging.debug(f"Valid paths: {vinput_paths}")
50+
if not vinput_paths:
51+
logging.error("No valid input files.")
52+
return 1
53+
del input_paths
54+
output_dir: str = console.input(
55+
"Input your output directory [bold]path[/bold]: "
56+
)
57+
if not os.path.exists(output_dir):
58+
logging.error(f"Output directory not found: {output_dir}")
59+
return 1
60+
elif not os.path.isdir(output_dir):
61+
logging.error(f"Output path is not a directory: {output_dir}")
62+
return 1
4563
logging.info("Finished main process.")
4664
return 0
4765

4866

49-
if __name__ == '__main__':
67+
if __name__ == "__main__":
5068
exit(main())

include/logo.ico

16.6 KB
Binary file not shown.

include/script.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
console.info("新年快乐!")
2+
// window.alert("新年快乐!")
3+
4+
const pageWidth = document.documentElement.scrollWidth;
5+
const pageHeight = document.documentElement.scrollHeight;
6+
console.info(`页面宽度: ${pageWidth}px, 页面高度: ${pageHeight}px`);

index.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
<meta name="keywords" content="红蓝灯, RBL">
1313
<meta http-equiv="Content-Language" content="zh-CN">
1414
<meta name="robots" content="all">
15-
<meta name="description" content="这里是红蓝灯的个人网站,欢迎你的到来!">
16-
<title>首页 - 红蓝灯的个人网站</title>
15+
<meta name="description" content="这里是红蓝灯的秘密基地,欢迎你的到来!">
16+
<title>首页 - 红蓝灯的秘密基地</title>
1717
<script src="include/prism.js"></script>
18+
<script src="include/script.js"></script>
1819
<link href="include/prism.css" rel="stylesheet">
1920
<link href="include/style.css" rel="stylesheet">
21+
<link href="include/logo.ico" rel="icon">
2022
</head>
2123
<body class="line-numbers">
2224
<nav id="topnav">
@@ -31,8 +33,8 @@
3133
</nav>
3234
<div id="nav-spacer" aria-hidden="true"></div>
3335
<div id="main">
34-
<h1 class="chinese funny" style="text-align: center;">Ciallo~(∠・ω< )⌒☆</h1>
35-
<p class="chinese" style="text-align: center;">这里是RBL的Web小窝!在这里,你可以:</p>
36+
<h1 class="chinese funny" style="text-align: center;">Ciallo~(∠・ω< )⌒☆ 新年快乐</h1>
37+
<p class="chinese" style="text-align: center;">这里是RBL的Web小窝&秘密基地!在这里,你可以:</p>
3638
<ul class="chinese">
3739
<li>下载我开发的各种软件</li>
3840
<li>阅读我写的各种文章</li>
@@ -45,7 +47,7 @@ <h1 class="chinese funny" style="text-align: center;">Ciallo~(∠・ω< )⌒
4547
<div id="notice">
4648
<h2 class="chinese" style="text-align: left;">公告</h2>
4749
<hr>
48-
<p class="chinese">主播终于结束了操蛋的校园生活,真是遗憾啊?也是成功画上了一个low得low的逗号好吧🤣
50+
<p class="chinese">主播终于结束了操蛋的校园生活,真是遗憾啊?也是成功画上了一个low的不能再low的逗号好吧🤣
4951
<br/>
5052
<strong>But</strong>还有下学期……放完暑假就六年级了……上初中还能打电脑吗?😥
5153
</p>
@@ -55,6 +57,7 @@ <h2 class="chinese" style="text-align: left;">公告</h2>
5557
<div id="copyright">
5658
<p class="chinese">© 2026 红蓝灯 保留所有权利才怪</p>
5759
<p class="english">© 2026 RBL All rights reserved? Hardly.</p>
60+
<p class="english" style="text-align: center;">Best view at 1528x740</p>
5861
</div>
5962
</body>
6063
</html>

0 commit comments

Comments
 (0)