移除req库
This commit is contained in:
parent
413a32b453
commit
8b3a95dbfd
|
@ -16,7 +16,7 @@ import base64
|
||||||
import json
|
import json
|
||||||
import traceback
|
import traceback
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import req as requests
|
import requests
|
||||||
import PyQt5.QtWidgets as QtWidgets
|
import PyQt5.QtWidgets as QtWidgets
|
||||||
from UI.AutoConfig import *
|
from UI.AutoConfig import *
|
||||||
from Model import *
|
from Model import *
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
# 此库用于实现 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:
|
|
||||||
print("52专版,将会无法连接服务器")
|
|
||||||
|
|
||||||
class Respon:
|
|
||||||
text = ""
|
|
||||||
|
|
||||||
def get(url, timeout=None): # -> requests.Response:
|
|
||||||
if unConnect:
|
|
||||||
# 全部 Url 都拦截
|
|
||||||
raise Exception("52专版不支持连接服务器")
|
|
||||||
if timeout == None:
|
|
||||||
return requests.get(url)
|
|
||||||
return requests.get(url, timeout=timeout)
|
|
||||||
|
|
||||||
def post(url, data, timeout=None):
|
|
||||||
if unConnect:
|
|
||||||
# 全部 Url 都拦截
|
|
||||||
raise Exception("52专版不支持连接服务器")
|
|
||||||
if timeout == None:
|
|
||||||
return requests.post(url, data)
|
|
||||||
return requests.post(url, data, timeout=timeout)
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue