MCPcopy
hub / github.com/pyload/pyload / call_cmd

Method call_cmd

module/plugins/internal/UnRar.py:202–244  ·  view source on GitHub ↗
(self, command, *xargs, **kwargs)

Source from the content-addressed store, hash-verified

200 return self.files
201
202 def call_cmd(self, command, *xargs, **kwargs):
203 args = []
204
205 #: Overwrite flag
206 if self.overwrite:
207 args.append("-o+")
208 else:
209 args.append("-o-")
210 args.append("-or")
211
212 for word in self.excludefiles:
213 args.append("-x%s" % word.strip())
214
215 #: Assume yes on all queries
216 args.append("-y")
217
218 #: Disable comments show
219 args.append("-c-")
220
221 #: Set a password
222 password = kwargs.get('password')
223
224 if password:
225 args.append("-p%s" % password)
226 else:
227 args.append("-p-")
228
229 if self.keepbroken:
230 args.append("-kb")
231
232 #@NOTE: return codes are not reliable, some kind of threading, cleanup whatever issue
233 call = [self.CMD, command] + args + list(xargs)
234 self.log_debug("EXECUTE " + " ".join(call))
235
236 call = map(fs_encode, call)
237 p = Popen(
238 call,
239 stdout=subprocess.PIPE,
240 stderr=subprocess.PIPE)
241
242 renice(p.pid, self.priority)
243
244 return p

Callers 4

verifyMethod · 0.95
repairMethod · 0.95
extractMethod · 0.95
listMethod · 0.95

Calls 6

PopenClass · 0.85
reniceFunction · 0.85
log_debugMethod · 0.80
joinMethod · 0.80
appendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected