Commit 3ca68ace authored by l2m2's avatar l2m2

upload.

parent f057c675
...@@ -128,5 +128,4 @@ dmypy.json ...@@ -128,5 +128,4 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
qrcode.png qrcode.png
dirty_demo.py \ No newline at end of file
\ No newline at end of file
...@@ -18,6 +18,15 @@ pyinstaller -F --icon=uploader.ico dingding-cookie-uploader.py ...@@ -18,6 +18,15 @@ pyinstaller -F --icon=uploader.ico dingding-cookie-uploader.py
pip install --upgrade 'setuptools<45.0.0' pip install --upgrade 'setuptools<45.0.0'
``` ```
- Processes stuck in loop with PyInstaller-executable
```
You need to use multiprocessing.freeze_support() when you produce a Windows executable with PyInstaller.
```
- TypeError: cafile, capath and cadata cannot be all omitted
## Reference ## Reference
- https://github.com/pypa/setuptools/issues/1963 - https://github.com/pypa/setuptools/issues/1963
- - https://stackoverflow.com/questions/57517371/matplotlibdeprecationwarning-with-pyinstaller-exe
\ No newline at end of file - https://stackoverflow.com/questions/54065079/processes-stuck-in-loop-with-pyinstaller-executable
\ No newline at end of file
from dingdinghelper import DingDingHelper from dingdinghelper import DingDingHelper
import requests import requests
import ctypes import ctypes
from multiprocessing import Process, freeze_support
def Mbox(title, text, style): def Mbox(title, text, style):
return ctypes.windll.user32.MessageBoxW(0, text, title, style) return ctypes.windll.user32.MessageBoxW(0, text, title, style)
if __name__ == "__main__": def f():
ding = DingDingHelper() ding = DingDingHelper()
ding.renew_cookie() ding.renew_cookie()
r = requests.post("http://139.196.104.13:9181/api/_/dingding/setCookie", json={ "cookie": ding.cookie }) r = requests.post("http://139.196.104.13:9181/api/_/dingding/setCookie", json={ "cookie": ding.cookie })
if r.status_code == 200: if r.status_code == 200:
Mbox('提示', '上传成功!', 0) Mbox('提示', '上传成功!', 0)
else: else:
Mbox('提示', '上传失败!', 0) Mbox('提示', '上传失败!', 0)
\ No newline at end of file
if __name__ == "__main__":
freeze_support()
Process(target=f).start()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment