Debian Codegraph @

src/devedeng/vlc.py

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