Upload sdwui-start-util.ipynb
Browse files- sdwui-start-util.ipynb +16 -3
sdwui-start-util.ipynb
CHANGED
@@ -427,6 +427,7 @@
|
|
427 |
"import os\n",
|
428 |
"import pprint\n",
|
429 |
"import re\n",
|
|
|
430 |
"from pathlib import Path\n",
|
431 |
"from typing import List\n",
|
432 |
"\n",
|
@@ -932,7 +933,20 @@
|
|
932 |
" elif 'gz' == format:\n",
|
933 |
" run(f'tar -czf {_output_path}/'+ zipName +'.tar.gz -C '+ path +' . ')\n",
|
934 |
" return\n",
|
935 |
-
" print('指定的目录不存在:'+path)\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
936 |
]
|
937 |
},
|
938 |
{
|
@@ -1212,12 +1226,11 @@
|
|
1212 |
" run('add-apt-repository ppa:deadsnakes/ppa -y')\n",
|
1213 |
" run('apt update -y')\n",
|
1214 |
" run('apt install nginx -y')\n",
|
1215 |
-
" run('apt install python3.
|
1216 |
" \n",
|
1217 |
"#安装依赖\n",
|
1218 |
"def install_dependencies():\n",
|
1219 |
" print('安装需要的python环境')\n",
|
1220 |
-
" import venv\n",
|
1221 |
" global envInstalled\n",
|
1222 |
" global venvPath\n",
|
1223 |
" if Path(f'{_install_path}/{_ui_dir_name}/venv').exists():\n",
|
|
|
427 |
"import os\n",
|
428 |
"import pprint\n",
|
429 |
"import re\n",
|
430 |
+
"import venv\n",
|
431 |
"from pathlib import Path\n",
|
432 |
"from typing import List\n",
|
433 |
"\n",
|
|
|
933 |
" elif 'gz' == format:\n",
|
934 |
" run(f'tar -czf {_output_path}/'+ zipName +'.tar.gz -C '+ path +' . ')\n",
|
935 |
" return\n",
|
936 |
+
" print('指定的目录不存在:'+path)\n",
|
937 |
+
" \n",
|
938 |
+
"def get_folder_list(directory:str): \n",
|
939 |
+
" folder_list = [] \n",
|
940 |
+
" for item in os.listdir(directory): \n",
|
941 |
+
" if os.path.isdir(os.path.join(directory, item)): \n",
|
942 |
+
" folder_list.append(item) \n",
|
943 |
+
" return folder_list \n",
|
944 |
+
"def read_text_file(file_path:str):\n",
|
945 |
+
" if not Path(file_path).exists(): return ''\n",
|
946 |
+
" with open(file_path,\"r\") as f:\n",
|
947 |
+
" text = file.read()\n",
|
948 |
+
" if text: return text.strip()\n",
|
949 |
+
" return ''"
|
950 |
]
|
951 |
},
|
952 |
{
|
|
|
1226 |
" run('add-apt-repository ppa:deadsnakes/ppa -y')\n",
|
1227 |
" run('apt update -y')\n",
|
1228 |
" run('apt install nginx -y')\n",
|
1229 |
+
" # run('apt install python3.10 -y')\n",
|
1230 |
" \n",
|
1231 |
"#安装依赖\n",
|
1232 |
"def install_dependencies():\n",
|
1233 |
" print('安装需要的python环境')\n",
|
|
|
1234 |
" global envInstalled\n",
|
1235 |
" global venvPath\n",
|
1236 |
" if Path(f'{_install_path}/{_ui_dir_name}/venv').exists():\n",
|