Skip to content

Commit 97c647c

Browse files
committed
Add new graph
1 parent 4947545 commit 97c647c

File tree

6 files changed

+115
-29
lines changed

6 files changed

+115
-29
lines changed

pyarmor/learn/en/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@
7474
js_switch_lang = '''
7575
window.addEventListener("DOMContentLoaded", () => {
7676
// View page source
77-
const element = document.querySelector("ul.wy-breadcrumbs > li.wy-breadcrumbs-aside > a")
77+
const element = document.querySelector("ul.this-page-menu > li > a")
7878
element.innerHTML = "中文"
7979
element.addEventListener("click", (e) => {
8080
e.preventDefault()
8181
window.location.assign(window.location.href.replace("/en/", "/zh/"))
8282
})
83+
document.querySelector('div.sphinxsidebarwrapper > div[aria-label="source link"] > h3').innerHTML = "Language"
8384
})
8485
'''
8586

pyarmor/learn/en/how-to.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
How to
33
========
44

5-
.. contents:: Content
6-
:depth: 2
7-
:local:
8-
:backlinks: top
9-
105
.. highlight:: console
116

127
.. _how-to-license:

pyarmor/learn/en/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ Table of content
2020
.. toctree::
2121
:caption: Learning Pyarmor
2222
:name: learndoc
23-
:numbered:
24-
:maxdepth: 3
23+
:maxdepth: 2
2524

2625
how-to
2726

pyarmor/learn/zh/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@
7474
js_switch_lang = '''
7575
window.addEventListener("DOMContentLoaded", () => {
7676
// View page source
77-
const element = document.querySelector("ul.wy-breadcrumbs > li.wy-breadcrumbs-aside > a")
77+
const element = document.querySelector("ul.this-page-menu > li > a")
7878
element.innerHTML = "English"
7979
element.addEventListener("click", (e) => {
8080
e.preventDefault()
8181
window.location.assign(window.location.href.replace("/zh/", "/en/"))
8282
})
83+
document.querySelector('div.sphinxsidebarwrapper > div[aria-label="source link"] > h3').innerHTML = "Language"
8384
})
8485
'''
8586

pyarmor/learn/zh/how-to.rst

Lines changed: 109 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
如何解决问题
33
==============
44

5-
.. contents:: 目录
6-
:depth: 2
7-
:local:
8-
:backlinks: top
9-
105
.. highlight:: console
116

127
.. _how-to-license:
@@ -45,6 +40,101 @@
4540
如何解决运行加密脚本过程中出现的问题
4641
------------------------------------
4742

43+
.. graphviz::
44+
:caption: 运行加密脚本出现问题的解决方案
45+
:align: center
46+
:name: graph-run-obfuscated-script-issue
47+
48+
digraph G {
49+
node [shape=box, style=rounded]
50+
51+
start [shape="doublecircle", label="",
52+
style="filled", fillcolor="wheat"]
53+
54+
subgraph P0 {
55+
rankdir="TB"
56+
style="setlinewidth(0)"
57+
58+
s1 [label="生成加密脚本的设备和运行加密脚本的设备\n两种是否相同?"]
59+
s2 [label="运行脚本的 Python 大小版本和\n生成脚本的 Python 大小版本\n两者是否相同?例如,都是 3.10"]
60+
s3 [label="运行结果中是否存在异常错误信息?"]
61+
s4 [label="如果使用 RFT 模式进行加密\n尝试禁用 RFT 模式进行加密\n执行加密脚本是否出错?"]
62+
s5 [label="如果使用了 BCC 模式进行加密\n尝试禁用 BCC 模式\n执行加密脚本是否出错?"]
63+
s6 [label="如果使用了约束选项进行加密\n尝试禁用约束选项进行加密\n执行加密脚本是否出错?"]
64+
s7 [label="如果使用了第三方库,先不要使用第三方库\n尝试加密一个简单脚本\n执行加密脚本是否出错?"]
65+
s8 [label="如果运行设备上 Python 是 alpha 版\n尝试升级 Python 到最新的小版本\n执行加密脚本是否出错?"]
66+
67+
s1 -> s2 -> s3
68+
s4 -> s5 -> s6 -> s7 -> s8
69+
}
70+
71+
start -> s1
72+
73+
subgraph P1 {
74+
node [
75+
style="filled,rounded",
76+
fillcolor="burlywood",
77+
]
78+
n1 [
79+
href="#graph-fix-runtime-cross-platform-issue"
80+
label="请参考跨平台发布问题的解决方案"]
81+
n2 [
82+
href="https://pyarmor.readthedocs.io/zh/latest/tutorial/advanced.html#support-multiple-python-versions"
83+
label="请使用相同版本的 Python 加密脚本\n如果需要支持不同版本的 Python\n请参考跨版本发布问题的解决方案"]
84+
n3 [href="https://pyarmor.readthedocs.io/zh/latest/reference/errors.html"
85+
label="请参考错误信息表查找相应的解决方案"]
86+
n4 [style=rounded
87+
label="请尝试在脚本中增加 print 语句\n找到导致问题出现的语句"]
88+
n5 [href="#graph-fix-runtime-crash-issue"
89+
label="请参考运行加密脚本崩溃解决方案"]
90+
n6 [
91+
href="https://pyarmor.readthedocs.io/zh/latest/topic/rftmode.html"
92+
label="请参考 RFT 专题文档"]
93+
n7 [
94+
href="https://pyarmor.readthedocs.io/zh/latest/topic/bccmode.html"
95+
label="请参考 BCC 专题文档"]
96+
n8 [href="https://pyarmor.readthedocs.io/zh/latest/reference/man.html#pyarmor-gen"
97+
label="详细了解相关选项的使用方法\n使用正确的约束选项\n或者修改脚本满足约束要求"]
98+
n9 [href="https://pyarmor.readthedocs.io/zh/latest/how-to/third-party.html"
99+
label="请参考常用第三方库解决方案"]
100+
n10 [href="https://github.com/dashingsoft/pyarmor/issues"
101+
label="提交报告问题,包含\n加密脚本使用的最少选项\n未使用第三方库的测试脚本"]
102+
}
103+
104+
s3 -> n3 [label="有异常"]
105+
s3 -> n4 [label="无异常"]
106+
s3 -> n5 [label="直接崩溃"]
107+
n3 -> s4 [label="未找到解决方案"]
108+
s8 -> n10 [label="依旧出错"]
109+
110+
n4 -> s4
111+
n5 -> s4
112+
113+
edge [tailport=se]
114+
s1 -> n1 [label="不相同"]
115+
s2 -> n2 [label="不相同"]
116+
s4 -> n6 [label="RFT 模式错误"]
117+
s5 -> n7 [label="BCC 模式错误"]
118+
s6 -> n8 [label="约束模式错误"]
119+
s7 -> n9 [label="第三方库错误"]
120+
}
121+
122+
.. graphviz::
123+
:caption: 跨平台发布加密脚本的解决方案
124+
:align: center
125+
:name: graph-fix-runtime-cross-platform-issue
126+
127+
digraph G {
128+
}
129+
130+
.. graphviz::
131+
:caption: 运行加密脚本崩溃的解决方案
132+
:align: center
133+
:name: graph-fix-runtime-crash-issue
134+
135+
digraph G {
136+
}
137+
48138
.. _run-packed-script-issue:
49139

50140
如何解决运行打包的可执行文件出现的问题
@@ -68,14 +158,15 @@
68158
s2 [label="在构建设备上,使用没有加密的脚本\n直接使用 PyInstaller 进行打包\n在客户设备上面运行打包好的可执行文件\n是否出错?"]
69159
s3 [label="在构建设备上面不要使用 --pack 选项\n而是仅仅加密脚本\n然后在客户设备上面直接运行\n是否依旧出错?"]
70160
s4 [label="在构建设备上面尝试去掉一些加密选项\n使用最少的加密选项对脚本进行打包\n然后在客户设备运行\n是否出错?"]
71-
s5 [label="如果脚本中使用了第三方库\n尝试加密打包一个简单脚本,\n然后在客户设备运行,\n是否出错?"]
72-
s6 [
161+
s5 [
73162
style="filled,rounded",
74163
fillcolor="burlywood",
75-
href="https://github.com/dashingsoft/pyarmor/issues"
76-
label="提交错误报告\n使用的命令行选项\n以及可以重现问题的简单脚本"]
164+
href="https://pyarmor.readthedocs.io/zh/latest/topic/repack.html"
165+
label="参考关于打包的详细说明\n使用没有出错的选项进行打包"]
166+
s6 [label="如果脚本中使用了第三方库\n尝试加密打包一个简单脚本,\n然后在客户设备运行,\n是否出错?"]
77167

78-
s2 -> s3 -> s4 -> s5 -> s6
168+
s2 -> s3 -> s4 -> s5
169+
s4 -> s6 [label="出错了", tailport=se]
79170
}
80171

81172
subgraph P2 {
@@ -91,18 +182,18 @@
91182
label="请使用加密脚本运行错误的解决方案"]
92183
n3 [
93184
href="https://pyarmor.readthedocs.io/zh/latest/how-to/third-party.html"
94-
label="查看第三方库是否能够兼容 Pyarmro+PyInstaller"]
95-
y1 [
96-
href="https://pyarmor.readthedocs.io/zh/latest/topic/repack.html"
97-
label="参考关于打包的详细说明\n使用没有出错的选项进行打包"]
185+
label="查看第三方库是否能够兼容 Pyarmor+PyInstaller"]
186+
n4 [
187+
href="https://github.com/dashingsoft/pyarmor/issues"
188+
label="提交错误报告,包含\n可以重现问题的最少命令行选项\n可以重现问题的尽可能的简单脚本\n脚本中不要使用第三方包"]
98189
}
99190

100191
start -> s2
192+
s6 -> n3
101193

102194
edge [tailport=se]
103195

104-
s2 -> n1
105-
s3 -> n2
106-
s4 -> y1
107-
s5 -> n3
196+
s2 -> n1 [label="出错了"]
197+
s3 -> n2 [label="出错了"]
198+
s6 -> n4 [label="出错了" tailport=e]
108199
}

pyarmor/learn/zh/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
.. toctree::
2121
:caption: 学习 Pyarmor
2222
:name: learndoc
23-
:numbered:
24-
:maxdepth: 3
23+
:maxdepth: 2
2524

2625
how-to
2726

0 commit comments

Comments
 (0)