forked from ZSAIm/iqiyi-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
57 lines (39 loc) · 1.08 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
"""
author: ZSAIm
github: https://github.com/ZSAIm/iqiyi-parser
"""
import gui
import wx, time, sys
import GUIEventBinder
import socket
import threading
import flow
import handler
from handler.logs import STDRedirect
import io
socket.setdefaulttimeout(3)
def main():
threading.Thread(target=__main__).start()
def __main__():
wx.CallAfter(flow.Entry.handle)
def wait_thread():
"""can't run while debugging"""
main_thread = threading.main_thread()
for i in threading.enumerate():
if i != main_thread:
i.join()
if __name__ == '__main__':
# with open('error.log', 'a+') as ferr:
# ferr.write('------------------------\n')
# ferr.write('%s\n' % time.asctime(time.localtime(time.time())))
# ferr.write('------------------------\n')
# sys.stderr = ferr
gui.init()
GUIEventBinder.init()
sys.stdout = STDRedirect(sys.stdout)
sys.stderr = STDRedirect(sys.stderr)
main()
gui.MainLoop()
# handler.downloader.join()
# wait_thread()