mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-13 18:42:03 +08:00
新增断网彩蛋
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
# 此库用于实现 52 版不连接程序服务器
|
||||
# 此库用于实现 52 版不连接程序服务器(不再区分)
|
||||
import requests
|
||||
|
||||
unConnect = False
|
||||
# 不再区分吾爱版
|
||||
#with open("/var/lib/dpkg/status", "r") as i:
|
||||
# unConnect = "Package: spark-deepin-wine-runner-52" in open("/var/lib/dpkg/status", "r").read()
|
||||
#if unConnect:
|
||||
@@ -11,17 +12,17 @@ class Respon:
|
||||
text = ""
|
||||
|
||||
def get(url, timeout=None): # -> requests.Response:
|
||||
if unConnect:
|
||||
#if unConnect:
|
||||
# 全部 Url 都拦截
|
||||
raise Exception("52专版不支持连接服务器")
|
||||
#raise Exception("52专版不支持连接服务器")
|
||||
if timeout == None:
|
||||
return requests.get(url)
|
||||
return requests.get(url, timeout=timeout)
|
||||
|
||||
def post(url, data, timeout=None):
|
||||
if unConnect:
|
||||
#if unConnect:
|
||||
# 全部 Url 都拦截
|
||||
raise Exception("52专版不支持连接服务器")
|
||||
# raise Exception("52专版不支持连接服务器")
|
||||
if timeout == None:
|
||||
return requests.post(url, data)
|
||||
return requests.post(url, data, timeout=timeout)
|
||||
Reference in New Issue
Block a user