fix for work on Windows.

feature/assist-websocket
Apex Liu 2021-11-26 04:10:05 +08:00
parent 6454bf0300
commit f71d9fa1b1
4 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,20 @@
# pip install -U pip
# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
# ... or ...
# pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# pip install -r requirements.txt
tornado
PyMySQL
psutil
Mako
Pillow
wheezy.captcha
qrcode
ldap3
cffi
# for Windows
pycryptodome
# for Linux
pycrypto

View File

@ -7,7 +7,7 @@
<content url="file://$MODULE_DIR$/webroot"> <content url="file://$MODULE_DIR$/webroot">
<sourceFolder url="file://$MODULE_DIR$/webroot" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/webroot" isTestSource="false" />
</content> </content>
<orderEntry type="jdk" jdkName="py37" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="py39" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="TemplatesService"> <component name="TemplatesService">

View File

@ -2,6 +2,7 @@
import os import os
import sys import sys
import platform
import signal import signal
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'webroot')) sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'webroot'))
@ -29,7 +30,8 @@ def main():
return 1 return 1
signal.signal(signal.SIGINT, signal_handler) # Ctrl-C signal.signal(signal.SIGINT, signal_handler) # Ctrl-C
signal.signal(signal.SIGHUP, signal_handler) # 发送给具有Terminal的Controlling Process当terminal 被disconnect时候发送 if platform.system().lower() != 'windows':
signal.signal(signal.SIGHUP, signal_handler) # 发送给具有Terminal的Controlling Process当terminal 被disconnect时候发送
signal.signal(signal.SIGTERM, signal_handler) # kill signal.signal(signal.SIGTERM, signal_handler) # kill
ret = g_web_app.run() ret = g_web_app.run()

View File

@ -25,7 +25,8 @@ if PLATFORM not in ['windows', 'linux', 'darwin']:
PATH_DATA = '' PATH_DATA = ''
# 将Python安装的扩展库移除避免开发调试与正式发布所依赖的库文件不一致导致发布的版本无法运行 # 将Python安装的扩展库移除避免开发调试与正式发布所依赖的库文件不一致导致发布的版本无法运行
if PLATFORM != 'darwin': # if PLATFORM != 'darwin':
if PLATFORM not in ['windows', 'darwin']:
x = [] x = []
for p in sys.path: for p in sys.path:
if p.find('site-packages') != -1 or p.find('dist-packages') != -1: if p.find('site-packages') != -1 or p.find('dist-packages') != -1: