Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: commits
[6812] CTK/trunk/CTK: Implements CTK.DownloadEntry_Exists().
 

Index | Next | Previous | View Flat


cherokee at cherokee-project

Aug 17, 2011, 8:19 AM


Views: 193
Permalink
[6812] CTK/trunk/CTK: Implements CTK.DownloadEntry_Exists().

Revision: 6812
http://svn.cherokee-project.com/changeset/6812
Author: alo
Date: 2011-08-17 17:19:29 +0200 (Wed, 17 Aug 2011)
Log Message:
-----------
Implements CTK.DownloadEntry_Exists(). It can inspect the download
objects and check whether a certain URL is being downloaded.

Modified Paths:
--------------
CTK/trunk/CTK/Downloader.py
CTK/trunk/CTK/__init__.py

Modified: CTK/trunk/CTK/Downloader.py
===================================================================
--- CTK/trunk/CTK/Downloader.py 2011-08-17 15:19:26 UTC (rev 6811)
+++ CTK/trunk/CTK/Downloader.py 2011-08-17 15:19:29 UTC (rev 6812)
@@ -54,7 +54,9 @@
/* Next step
*/
if ((info.status == 'init') ||
- (info.status == 'downloading')) {
+ (info.status == 'downloading'))
+ {
+ $('#%(progressbar_id)s').trigger ( $.extend({'type':'update'}, info));
window.setTimeout (update_progress_%(id)s, 1000);

} else if (info.status == 'stopped') {
@@ -89,12 +91,14 @@
def __init__ (self, url):
threading.Thread.__init__ (self)

- self.url = url
- self.size = 0
- self.percent = 0
- self.downloaded = 0
- self.status = 'init'
- self.wanna_exit = False
+ self.url = url
+ self.size = 0
+ self.percent = 0
+ self.downloaded = 0
+ self.status = 'init'
+ self.wanna_exit = False
+ self.target_temp = None
+ self.target_path = None

def stop (self):
self.status = 'stopped'
@@ -162,6 +166,9 @@
downloads[url] = tmp
return downloads[url]

+def DownloadEntry_Exists (url):
+ global downloads
+ return downloads.has_key (url)

class DownloadReport:
lock = threading.RLock()

Modified: CTK/trunk/CTK/__init__.py
===================================================================
--- CTK/trunk/CTK/__init__.py 2011-08-17 15:19:26 UTC (rev 6811)
+++ CTK/trunk/CTK/__init__.py 2011-08-17 15:19:29 UTC (rev 6812)
@@ -63,7 +63,7 @@
from Druid import Druid, DruidButtonsPanel, DruidButton, DruidButton_Goto, DruidButton_Close, DruidButton_Submit, DruidButtonsPanel_Next, DruidButtonsPanel_PrevNext, DruidButtonsPanel_PrevCreate, DruidButtonsPanel_Create, DruidButtonsPanel_Cancel, DruidButtonsPanel_Close, DruidButtonsPanel_Next_Auto, DruidButtonsPanel_PrevNext_Auto, DruidButtonsPanel_PrevCreate_Auto, DruidContent_TriggerNext, DruidContent__JS_to_goto, DruidContent__JS_to_goto_next, DruidContent__JS_to_close, DruidContent__JS_if_external_submit, DruidContent__JS_if_internal_submit
from List import List, ListEntry
from ProgressBar import ProgressBar
-from Downloader import Downloader, DownloadEntry_Factory
+from Downloader import Downloader, DownloadEntry_Factory, DownloadEntry_Exists
from Radio import Radio, RadioText, RadioGroupCfg
from XMLRPCProxy import XMLRPCProxy
from AjaxUpload import AjaxUpload, AjaxUpload_Generic

Subject User Time
[6812] CTK/trunk/CTK: Implements CTK.DownloadEntry_Exists(). cherokee at cherokee-project Aug 17, 2011, 8:19 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.