Changeset bcdc845341716e64935c3f5371b74473b68d61d8
- Timestamp:
- 04/08/08 22:11:31
(9 months ago)
- Author:
- Jason Michalski <armooo@armooo.net>
- git-committer:
- Jason Michalski <armooo@armooo.net> 1207710691 -0500
- git-parent:
[9567aeae71db6082ee952d3bf002c3897db5363d]
- git-author:
- Jason Michalski <armooo@armooo.net> 1207544840 -0500
- Message:
Check for new downloads every 15mins
If we don't the tivo will say we have not been connecting
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r098d6b5 |
rbcdc845 |
|
| 10 | 10 | import shutil |
|---|
| 11 | 11 | import os.path |
|---|
| | 12 | import time |
|---|
| 12 | 13 | import os |
|---|
| 13 | 14 | import urlparse |
|---|
| … | … | |
| 32 | 33 | |
|---|
| 33 | 34 | self.startXMPP() |
|---|
| 34 | | self.xmpp_cdsupdate() |
|---|
| 35 | 35 | self.startWorkerThreads() |
|---|
| 36 | 36 | |
|---|
| … | … | |
| 64 | 64 | def startWorkerThreads(self): |
|---|
| 65 | 65 | for i in range(self.download_thread_num): |
|---|
| 66 | | t = threading.Thread(target=self.processDlRequest) |
|---|
| | 66 | t = threading.Thread(target=self.processDlRequest, name='webvideo downloader') |
|---|
| 67 | 67 | t.setDaemon(True) |
|---|
| 68 | 68 | t.start() |
|---|
| | 69 | |
|---|
| | 70 | t = threading.Thread(target=self.watchQueue, name='webvideo queue watcher') |
|---|
| | 71 | t.setDaemon(True) |
|---|
| | 72 | t.start() |
|---|
| 69 | 73 | |
|---|
| 70 | 74 | def processXMPP(self, client): |
|---|
| … | … | |
| 82 | 86 | method = getattr(self, method_name) |
|---|
| 83 | 87 | method(xmpp_action) |
|---|
| | 88 | |
|---|
| | 89 | def watchQueue(self): |
|---|
| | 90 | while True: |
|---|
| | 91 | self.xmpp_cdsupdate() |
|---|
| | 92 | time.sleep(60*15) |
|---|
| 84 | 93 | |
|---|
| 85 | 94 | def xmpp_cdsupdate(self, xml=None): |
|---|