This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import threading | |
from Queue import Queue | |
import sys, os, re | |
class ThreadedDownload(object): | |
REGEX = { | |
'hostname_strip':re.compile('.*\..*?/', re.I) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Like jQuery's trigger(), only the firing of the event can be delayed by the | |
// specified duration (in milliseconds). The timer is reset on consecutive | |
// triggers with the same event name, so only the most recent event will be | |
// triggered when the duration ends. Useful if you need to prevent events from | |
// queueing up. | |
// | |
// $('#foo').bind('myEventName', function() {alert('hai')}); | |
// ... | |
// $('#foo').delayedTrigger(1000, 'myEventName', 'event1'); | |
// $('#foo').delayedTrigger(1000, 'myEventName', 'event2'); |
NewerOlder