Author: duncan
Date: Sat Jul 28 06:38:54 2007
New Revision: 9776
Log:
Fixed the silly bug that I introduced in childapp.
String commands need to be run through a shell.
Modified:
branches/rel-1/freevo/src/childapp.py
branches/rel-1/freevo/src/config.py
branches/rel-1/freevo/src/tv/plugins/vbi2srt_record.py
Modified: branches/rel-1/freevo/src/childapp.py
==============================================================================
--- branches/rel-1/freevo/src/childapp.py (original)
+++ branches/rel-1/freevo/src/childapp.py Sat Jul 28 06:38:54 2007
@@ -125,15 +125,18 @@
command_isstr = isinstance(command, str)
if command_isstr:
- command = command.strip() # strip spaces from the command string
+ #command = command.strip() # strip spaces from the command string
+ command_shell = True
command_str = command
else:
+ command_shell = False
command_str = ' '.join(command)
self.child = None
try:
- self.child = Popen(command, shell=False, stdin=PIPE, stdout=PIPE,
stderr=PIPE)
- _debug_('Running (%s) "%s" with pid %s priority %s' % (\
- command_isstr and 'str' or 'list', command_str,
self.child.pid, prio), 1)
+ self.child = Popen(command, shell=command_shell, stdin=PIPE,
stdout=PIPE, stderr=PIPE)
+ _debug_('Running (%s) "%s"%s with pid %s priority %s' % (\
+ command_isstr and 'str' or 'list', command_str, command_shell
and ' in shell' or '', \
+ self.child.pid, prio), 1)
except OSError, e:
_debug_('Cannot run "%s": %s' % (command_str, e), config.DERROR)
self.ready = False
Modified: branches/rel-1/freevo/src/config.py
==============================================================================
--- branches/rel-1/freevo/src/config.py (original)
+++ branches/rel-1/freevo/src/config.py Sat Jul 28 06:38:54 2007
@@ -427,7 +427,7 @@
vals = line.split()
_debug_('Cfg file data: "%s"' % line, 2)
try:
- name, val = vals[0], vals[2]
+ name, val = vals[0].strip(), vals[2].strip()
except:
print 'Error parsing config file data "%s"' % line
continue
@@ -975,6 +975,9 @@
if not HELPER:
_debug_( "Using '%s' encoding" % encoding )
+for k,v in CONF.__dict__.items():
+ _debug_('%r: %r' % (k, v), 1)
+
# make sure USER and HOME are set
os.environ['USER'] = pwd.getpwuid(os.getuid())[0]
os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
Modified: branches/rel-1/freevo/src/tv/plugins/vbi2srt_record.py
==============================================================================
--- branches/rel-1/freevo/src/tv/plugins/vbi2srt_record.py (original)
+++ branches/rel-1/freevo/src/tv/plugins/vbi2srt_record.py Sat Jul 28
06:38:54 2007
@@ -119,7 +119,7 @@
rec_prog.filename = tv_util.getProgFilename(rec_prog)
rec_prog.filename =
os.path.splitext(tv_util.getProgFilename(rec_prog))[0] + '.mpeg'
- _debug_('Recorder::Record:filename %s' % rec_prog.filename)
+ _debug_('filename %s' % rec_prog.filename)
cl_options = { 'channel' : rec_prog.tunerid,
'frequency' : frequency,
@@ -134,16 +134,16 @@
}
self.vg = self.fc.getVideoGroup(rec_prog.tunerid, False)
- _debug_('Recorder::Record:cl_options %s' % cl_options)
- _debug_('Recorder::Record:chan_index %s' % self.fc.chan_index)
- _debug_('Recorder::Record:vg.vdev %s' % self.vg.vdev)
- _debug_('Recorder::Record:vg.vvbi %s' % self.vg.vvbi)
+ _debug_('cl_options %s' % cl_options)
+ _debug_('chan_index %s' % self.fc.chan_index)
+ _debug_('vg.vdev %s' % self.vg.vdev)
+ _debug_('vg.vvbi %s' % self.vg.vvbi)
pagenum = None;
try:
pagenum = int(config.TV_CHANNELS[self.fc.chan_index][5])
except:
pagenum = None;
- _debug_('Recorder::Record:pagenum "%s"' % pagenum)
+ _debug_('pagenum "%s"' % pagenum)
# this is not used
if isinstance(config.VCR_CMD, str) or isinstance(config.VCR_CMD,
unicode):
@@ -169,7 +169,7 @@
self.thread.autokill = float(rec_prog.rec_duration + 10)
self.thread.mode_flag.set()
- _debug_('Recorder::Record: %s' % self.rec_command)
+ _debug_('rec_command=%r' % self.rec_command)
def Stop(self):
@@ -220,14 +220,14 @@
def run(self):
while 1:
- _debug_('Record_Thread::run: mode=%s' % self.mode)
+ _debug_('mode=%s' % self.mode)
if self.mode == 'idle':
self.mode_flag.wait()
self.mode_flag.clear()
elif self.mode == 'record':
rc.post_event(Event('RECORD_START', arg=self.prog))
- _debug_('Record_Thread::run: cmd=%s' % self.command)
+ _debug_('cmd=%r' % self.command)
fc = FreevoChannels()
_debug_('CHAN: %s' % fc.getChannel())
@@ -260,12 +260,12 @@
if self.app.isAlive():
# might not want to do this is PDC is valid, programme may
be delayed
- _debug_('Record_Thread::run: past wait!!')
+ _debug_('past wait!!')
rc.post_event(Event(OS_EVENT_KILL, (self.app.child.pid,
15)))
self.app.kill()
rc.post_event(Event('RECORD_STOP', arg=self.prog))
- _debug_('Record_Thread::run: finished recording')
+ _debug_('finished recording')
self.mode = 'idle'
else:
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog