-
Notifications
You must be signed in to change notification settings - Fork 11
/
devede_dvd.py
executable file
·80 lines (64 loc) · 2.36 KB
/
devede_dvd.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2006-2007 (C) Raster Software Vigo (Sergio Costas)
# Copyright 2006-2007 (C) Peter Gill - win32 parts
# This file is part of DeVeDe
#
# DeVeDe is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# DeVeDe is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import signal
import os
import sys
import re
import shutil
import devede_executor
class dvd_generator(devede_executor.executor):
def __init__(self,filename,filefolder,progresbar,proglabel):
devede_executor.executor.__init__(self,filename,filefolder,progresbar)
proglabel.set_text(_("Creating DVD tree structure"))
if (sys.platform=="win32") or (sys.platform=="win64"):
command="dvdauthor.exe"
else:
command="dvdauthor"
self.print_error=_("Failed to create the DVD tree\nMaybe you ran out of disk space")
self.launch_program([command,"-x",filefolder+filename+".xml"])
def set_progress_bar(self):
if (sys.platform=="win32") or (sys.platform=="win64"):
# This seems to be about all that can be done with dvdauthor on windows
self.bar.pulse()
return True
if self.cadena.find("INFO: Video")!=-1:
self.bar.pulse()
return True
else:
position=self.cadena.find("STAT: VOBU ")
if position!=-1:
self.bar.pulse()
self.bar.set_text("VOBU "+self.cadena[position+11:self.cadena.find(" ",position+11)])
return True
else:
position=self.cadena.find("STAT: fixing VOBU at ")
if (position!=-1):
position2=self.cadena.find("%",position+21)
if (position2!=-1):
cadena=self.cadena[position2-2:position2]
self.bar.set_text(cadena+"%")
self.bar.set_fraction((float(cadena.replace(",",".")))/100.0)
self.read_chars=200
return True
return False
def end_process(self,eraser,erase_temporal_files):
if erase_temporal_files:
eraser.delete_mpg()
eraser.delete_menu()
eraser.delete_xml()