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

Method call_cmd

module/plugins/internal/OCR.py:51–72  ·  view source on GitHub ↗

Run a command

(self, command, *args, **kwargs)

Source from the content-addressed store, hash-verified

49 self.img = self.img.point(lambda a: a * value + 10)
50
51 def call_cmd(self, command, *args, **kwargs):
52 """
53 Run a command
54 """
55 call = (command,) + args
56 self.log_debug("EXECUTE " + " ".join(call))
57
58 call = map(fs_encode, call)
59 p = Popen(
60 call,
61 bufsize=-1,
62 stdout=subprocess.PIPE,
63 stderr=subprocess.PIPE)
64 p.wait()
65
66 output = p.stdout.read() + " | " + p.stderr.read()
67
68 p.stdout.close()
69 p.stderr.close()
70
71 self.log_debug("Tesseract ReturnCode %d" % p.returncode,
72 "Output: %s" % output)
73
74 def run_tesser(self, subset=False, digits=True,
75 lowercase=True, uppercase=True, pagesegmode=None):

Callers 1

run_tesserMethod · 0.95

Calls 6

PopenClass · 0.85
log_debugMethod · 0.80
joinMethod · 0.80
waitMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected