Update mw.py

pull/628/head
Mr Chen 6 months ago
parent c04e52d3df
commit 0c9fe565e4
  1. 12
      web/core/mw.py

@ -541,6 +541,18 @@ def isNumber(s):
return False
# 检查端口是否占用
def isOpenPort(port):
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect(('127.0.0.1', int(port)))
s.shutdown(2)
return True
except Exception as e:
return False
def debugLog(*data):
if isDebugMode():
print(data)

Loading…
Cancel
Save