def play(self):
if self._process is None:
if self.station:
fifo_path = self._create_fifo()
if fifo_path:
self._process = subprocess.Popen(self._cmd.format(fifo=fifo_path, url=self.station),
stdin=subprocess.PIPE,
stdout=open('/dev/null', 'w'),
stderr=open('/dev/null', 'w'),
shell=True, preexec_fn=os.setsid)
if self._is_running():
self._volume = 100
else:
print "Error: no station selected"
else:
print "Error: Already playing"
评论列表
文章目录