From fbee8354739ecb45aa70345a7ee3a7b0584e6766 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Fri, 19 Dec 2008 01:30:32 +0000 Subject: use OS.system instead of commands.getstatusoutput --- (limited to 'TamTamJam.activity') diff --git a/TamTamJam.activity/Jam/JamMain.py b/TamTamJam.activity/Jam/JamMain.py index 77e97d1..e9dde2a 100644 --- a/TamTamJam.activity/Jam/JamMain.py +++ b/TamTamJam.activity/Jam/JamMain.py @@ -29,6 +29,7 @@ from common.Generation.GenerationConstants import GenerationConstants from common.Util.NoteDB import Note, Page from common.Util import ControlStream +from common.Util import OS import xdrlib import time @@ -698,10 +699,10 @@ class JamMain(gtk.EventBox): if os.path.isfile(os.path.join(Config.DATA_DIR, mic)): os.system('rm ' + Config.DATA_DIR + '/' + mic) self.csnd.inputMessage("i5600 0 4") - (s1,o1) = commands.getstatusoutput("arecord -f S16_LE -t wav -r 16000 -d 4 " + Config.DATA_DIR + "/tempMic.wav") - (s2, o2) = commands.getstatusoutput("csound " + "--strset999=" + Config.DATA_DIR + " " + Config.FILES_DIR + "/crop.csd") - (s3, o3) = commands.getstatusoutput("mv " + Config.DATA_DIR + "/micTemp.wav " + Config.DATA_DIR + "/" + mic) - (s4, o4) = commands.getstatusoutput("rm " + Config.DATA_DIR + "/tempMic.wav") + OS.system("arecord -f S16_LE -t wav -r 16000 -d 4 " + Config.DATA_DIR + "/tempMic.wav") + OS.system("csound " + "--strset999=" + Config.DATA_DIR + " " + Config.FILES_DIR + "/crop.csd") + OS.system("mv " + Config.DATA_DIR + "/micTemp.wav " + Config.DATA_DIR + "/" + mic) + OS.system("rm " + Config.DATA_DIR + "/tempMic.wav") self.csnd.load_mic_instrument(mic) diff --git a/TamTamJam.activity/Jam/Toolbars.py b/TamTamJam.activity/Jam/Toolbars.py index 4a1d3fc..354ec15 100644 --- a/TamTamJam.activity/Jam/Toolbars.py +++ b/TamTamJam.activity/Jam/Toolbars.py @@ -18,6 +18,7 @@ from sugar.graphics.toolcombobox import ToolComboBox from common.Util.ThemeWidgets import * import common.Config as Config +from common.Util import OS class JamToolbar( gtk.Toolbar ): @@ -496,7 +497,7 @@ class LoopSettingsPalette( Palette ): def handleSound(self, widget, data=None): self.sndname = self.sounds[widget.props.value] fullname = Config.DATA_DIR + '/' + self.sndname - results = commands.getstatusoutput("du -b %s" % fullname) + results = OS.system("du -b %s" % fullname) if results[0] == 0: list = results[1].split() soundLength = float(list[0]) / 2 / 16000. @@ -543,7 +544,7 @@ class LoopSettingsPalette( Palette ): ofile.write(category) ofile.close() if copy: - (s,o) = commands.getstatusoutput('cp ' + Config.DATA_DIR + '/' + oldName + ' ' + Config.DATA_DIR + '/' + self.sndname) + OS.system('cp ' + Config.DATA_DIR + '/' + oldName + ' ' + Config.DATA_DIR + '/' + self.sndname) def set_values(self, soundLength): self.soundLength = soundLength -- cgit v0.9.1