|
a/src/filters/rclexec1.py |
|
b/src/filters/rclexec1.py |
|
... |
|
... |
23 |
#
|
23 |
#
|
24 |
# This was motivated by the Windows port: to replace shell and Unix
|
24 |
# This was motivated by the Windows port: to replace shell and Unix
|
25 |
# utility (awk , etc usage). We can't just execute python scripts,
|
25 |
# utility (awk , etc usage). We can't just execute python scripts,
|
26 |
# this would be to slow. So this helps implementing a permanent script
|
26 |
# this would be to slow. So this helps implementing a permanent script
|
27 |
# to repeatedly execute single commands.
|
27 |
# to repeatedly execute single commands.
|
|
|
28 |
|
|
|
29 |
from __future__ import print_function
|
28 |
|
30 |
|
29 |
import subprocess
|
31 |
import subprocess
|
30 |
import rclexecm
|
32 |
import rclexecm
|
31 |
|
33 |
|
32 |
# This class has the code to execute the subprocess and call a
|
34 |
# This class has the code to execute the subprocess and call a
|
|
... |
|
... |
72 |
def extractone(self, params):
|
74 |
def extractone(self, params):
|
73 |
#self.em.rclog("extractone %s %s" % (params["filename:"], \
|
75 |
#self.em.rclog("extractone %s %s" % (params["filename:"], \
|
74 |
# params["mimetype:"]))
|
76 |
# params["mimetype:"]))
|
75 |
self.flt.reset()
|
77 |
self.flt.reset()
|
76 |
ok = False
|
78 |
ok = False
|
77 |
if not params.has_key("filename:"):
|
79 |
if not "filename:" in params:
|
78 |
self.em.rclog("extractone: no mime or file name")
|
80 |
self.em.rclog("extractone: no file name")
|
79 |
return (ok, "", "", rclexecm.RclExecM.eofnow)
|
81 |
return (ok, "", "", rclexecm.RclExecM.eofnow)
|
80 |
|
82 |
|
81 |
fn = params["filename:"]
|
83 |
fn = params["filename:"]
|
82 |
while True:
|
84 |
while True:
|
83 |
cmdseq = self.flt.getCmd(fn)
|
85 |
cmdseq = self.flt.getCmd(fn)
|