[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r7546 - in grc/trunk/src: . SignalBlockDefs
From: |
jblum |
Subject: |
[Commit-gnuradio] r7546 - in grc/trunk/src: . SignalBlockDefs |
Date: |
Sat, 2 Feb 2008 23:06:18 -0700 (MST) |
Author: jblum
Date: 2008-02-02 23:06:17 -0700 (Sat, 02 Feb 2008)
New Revision: 7546
Modified:
grc/trunk/src/ActionHandler.py
grc/trunk/src/ExecFlowGraph.py
grc/trunk/src/ExecFlowGraphGUI.py
grc/trunk/src/SignalBlockDefs/SignalBlockTree.py
Log:
switched from os.system to popen, switched to sys.exit, commented out rs232 in
tree
Modified: grc/trunk/src/ActionHandler.py
===================================================================
--- grc/trunk/src/ActionHandler.py 2008-02-02 08:56:10 UTC (rev 7545)
+++ grc/trunk/src/ActionHandler.py 2008-02-03 06:06:17 UTC (rev 7546)
@@ -20,7 +20,7 @@
#ActionHandler builds the interface and handles most of the user inputs.
address@hidden Josh Blum
-import os, sys
+import os, sys, popen2
from Constants import *
from Actions import *
import pygtk
@@ -356,7 +356,6 @@
rand_id = random.randint(10000, 99999)
#set files
self.file_path = self.page.get_file_path()
- self.report_file = '/tmp/grc-%d-%d.report'%(os.getpid(),
rand_id)
self.pid_file = '/tmp/grc-%d-%d.pid'%(os.getpid(), rand_id)
self.page.set_pid_file(self.pid_file)
self.update_exec_stop()
@@ -365,20 +364,14 @@
def run(self):
"""Execute the flow graph."""
- cmd = '%s "%s" --pid_file="%s" 2> "%s"'%(
+ cmd = '%s "%s" --pid_file="%s"'%(
DEFAULT_FLOW_GRAPH_EXEC,
self.file_path,
- self.pid_file,
- self.report_file,
+ self.pid_file
)
- os.system(cmd)
- try:
- report = open(self.report_file, 'r')
- # read all the lines of the report file into a
list #
- Messages.send_end_exec(report.readlines())
- report.close()
- os.remove(self.report_file)
- except IOError: print "could not read report file:
%s"%self.report_file
+ p = popen2.Popen3(cmd=cmd, capturestderr=True)
+ #read all the lines of the stderr into a list
+ Messages.send_end_exec(p.childerr.readlines())
try: os.remove(self.pid_file)
except: print "could not remove pid file: %s"%self.pid_file
self.page.set_pid_file('')
Modified: grc/trunk/src/ExecFlowGraph.py
===================================================================
--- grc/trunk/src/ExecFlowGraph.py 2008-02-02 08:56:10 UTC (rev 7545)
+++ grc/trunk/src/ExecFlowGraph.py 2008-02-03 06:06:17 UTC (rev 7546)
@@ -25,7 +25,7 @@
import Variables
from Elements import SignalBlock
from gnuradio import gr
-import os
+import os, sys
from Constants import FLOW_GRAPH_FILE_EXTENSION,MUTEX
from optparse import OptionParser
@@ -183,7 +183,7 @@
exit(-1)
if not len(args):
self.print_help()
- exit(-1)
+ sys.exit(-1)
return options, args
##############################################################################################
@@ -196,5 +196,5 @@
fg.start()
raw_input('Flow Graph Running...\nPress Enter to Exit: ')
fg.stop()
- exit(0)
-
\ No newline at end of file
+ sys.exit(0)
+
Modified: grc/trunk/src/ExecFlowGraphGUI.py
===================================================================
--- grc/trunk/src/ExecFlowGraphGUI.py 2008-02-02 08:56:10 UTC (rev 7545)
+++ grc/trunk/src/ExecFlowGraphGUI.py 2008-02-03 06:06:17 UTC (rev 7546)
@@ -67,7 +67,7 @@
try: slider.SetRange(0, num_steps)
except Exception, e:
sys.stderr.write('Slider, "%s", has too many
steps!\n'%key)
- sys.exit(1)
+ sys.exit(-1)
slider.Bind(wx.EVT_SCROLL, self._handle_scroll) #bind the
scrolling event
self.Add(slider, 0, wx.ALIGN_CENTER)
self._set_slider_value(value)#sets the slider's value
@@ -245,6 +245,6 @@
app = FlowGraphApp(args[0])
if options.no_wx: raw_input('Flow Graph Running...\nPress Enter to
Exit: ') #do not start wx
else: app.MainLoop() #start the wxApp MainLoop
- exit(0)
+ sys.exit(0)
-
\ No newline at end of file
+
Modified: grc/trunk/src/SignalBlockDefs/SignalBlockTree.py
===================================================================
--- grc/trunk/src/SignalBlockDefs/SignalBlockTree.py 2008-02-02 08:56:10 UTC
(rev 7545)
+++ grc/trunk/src/SignalBlockDefs/SignalBlockTree.py 2008-02-03 06:06:17 UTC
(rev 7546)
@@ -49,7 +49,7 @@
('Audio Source', Audio.AudioSource),
('USRP Source', USRP.USRPSource),
('USRP Dual Source', USRP.USRPDualSource),
- ('RS232 Source', Sources.RS232Source),
+ #('RS232 Source', Sources.RS232Source),
]),
('Sinks', [
('Variable Sink', Sinks.VariableSink),
@@ -59,7 +59,7 @@
('Audio Sink', Audio.AudioSink),
('USRP Sink', USRP.USRPSink),
('USRP Dual Sink', USRP.USRPDualSink),
- ('RS232 Sink', Sinks.RS232Sink),
+ #('RS232 Sink', Sinks.RS232Sink),
]),
('Graphical Sinks', [
('Numerical Sink',
GraphicalSinks.NumericalSink),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r7546 - in grc/trunk/src: . SignalBlockDefs,
jblum <=