MCPcopy Index your code
hub / github.com/pyload/pyload / activate

Method activate

module/plugins/hooks/ExtractArchive.py:134–158  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

132 self.repair = False
133
134 def activate(self):
135 for p in ("HjSplit", "UnRar", "SevenZip", "UnZip", "UnTar"):
136 try:
137 module = self.pyload.pluginManager.loadModule("internal", p)
138 klass = getattr(module, p)
139 if klass.find():
140 self.extractors.append(klass)
141 if klass.REPAIR:
142 self.repair = self.config.get('repair')
143
144 except OSError, e:
145 if e.errno == 2:
146 self.log_warning(_("No %s installed") % p)
147 else:
148 self.log_warning(_("Could not activate: %s") % p, e)
149
150 except Exception, e:
151 self.log_warning(_("Could not activate: %s") % p, e)
152
153 if self.extractors:
154 self.log_debug(*["Found %s %s" % (Extractor.__name__, Extractor.VERSION)
155 for Extractor in self.extractors])
156 self.extract_queued() #: Resume unfinished extractions
157 else:
158 self.log_info(_("No Extract plugins activated"))
159
160 @threaded
161 def extract_queued(self, thread):

Callers

nothing calls this directly

Calls 9

extract_queuedMethod · 0.95
loadModuleMethod · 0.80
log_warningMethod · 0.80
log_debugMethod · 0.80
log_infoMethod · 0.80
_Function · 0.50
findMethod · 0.45
appendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected