Run a command
(self, command, *args, **kwargs)
| 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): |