Debian Codegraph @

src/devedeng/mplayer.py

raw
1 #!/usr/bin/env python3
2
3 # Copyright 2014 (C) Raster Software Vigo (Sergio Costas)
4 #
5 # This file is part of DeVeDe-NG
6 #
7 # DeVeDe-NG is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 3
9 # as published by the Free Software Foundation.
10 #
11 # DeVeDe-NG is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>
18
19 import subprocess
20 import devedeng.configuration_data
21 import devedeng.executor
22 import os
23
24
25 class mplayer(devedeng.executor.executor):
26
27 supports_analize = False
28 supports_play = True
29 supports_convert = False
30 supports_menu = False
31 supports_mkiso = False
32 supports_burn = False
33 display_name = "MPLAYER"
34
35 @staticmethod
36 def check_is_installed():
37 try:
38 handle = subprocess.Popen(
39 ["mplayer", "-v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
40 (stdout, stderr) = handle.communicate()
41 if 0 == handle.wait():
42 return True
43 else:
44 return False
45 except:
46 return False
47
48 def __init__(self):
49
50 devedeng.executor.executor.__init__(self)
51 self.config = devedeng.configuration_data.configuration.get_config()
52
53 def play_film(self, file_name):
54
55 command_line = ["mplayer", file_name]
56 self.launch_process(command_line)
57
58 def process_stdout(self, data):
59 return
60
61 def process_stderr(self, data):
62 return