-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.py
More file actions
32 lines (28 loc) · 761 Bytes
/
init.py
File metadata and controls
32 lines (28 loc) · 761 Bytes
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
#!/usr/bin/python
#encoding=utf-8
import sys
sys.path.append('./')
import Queue, socket
from main import Main
from PyQt4 import QtWebKit, QtGui, QtCore
from workmgr import WorkMgr
from imagedownloader import ImageDownloader
from archivedownloader import ArchiveDownloader
import threading
'''
class Watcher():
def __init__(self, wm):
self.wm = wm
def time(self):
threading.Timer(20.0, self.time).start()
print 'Queue:qsize():' + str(self.wm.queue.qsize())
'''
socket.setdefaulttimeout(5)
app = QtGui.QApplication(sys.argv)
archdown = ArchiveDownloader()
queue = Queue.Queue(maxsize=0)
imgdown = WorkMgr(queue, ImageDownloader)
#watcher = Watcher(imgdown)
main = Main(archdown, imgdown, queue, watcher='NULL')
#archdown.start()
sys.exit(app.exec_())