Anonymous     Python     31 Aug 2011    
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
TUBE_MODULES = ['tubeutils.extremetube', 'tubeutils.keezmoves_', 'tubeutils.pornhub_',
'tubeutils.spankwire', 'tubeutils.tube8_', 'tubeutils.xtube_',
'tubeutils.youporn_', 'tubeutils.redtube_']
def __init__(self, resultfile, cycles, modules=TUBE_MODULES, log=logger):
self.logger = log
# load modules
for mod in modules:
try:
package_obj = __import__(mod)
self.extensions.append(mod)
except ImportError:
log.debug("\tCan't import %s module" % mod)
for mod in self.extensions:
module_obj = getattr(package_obj, mod.split('.')[1])
ext = inspect.getmembers(module_obj, inspect.isclass)
for name, obj in ext:
if issubclass(obj, BaseTube):
plugin = obj(self.logger)
plugin.ads_parser(cycles=cycles, filename=resultfile)