#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2006-2009 (C) Raster Software Vigo (Sergio Costas)
# Copyright 2006-2009 (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 .
#################################################################
# This block contains all the functions to convert a video file #
# into an MPEG2-PS DVD-compliant file #
#################################################################
import time
import select
import signal
import subprocess
import sys
import os
import re
import shutil
import glob
import posixpath
import gtk
import devede_other
import gobject
import cairo
if (sys.platform=="win32") or (sys.platform=="win64"):
import win32api
import devede_burn
import devede_other
import devede_video_convert
import devede_subtitles
import devede_xml_menu
import devede_delete
import devede_dvd
import devede_bincue
import devede_executor
import devede_dialogs
import gc
class create_all:
def cancel_clicked(self,widget,temp=False):
newtree=devede_other.create_tree(self,"wcancel_job_dialog",self.gladefile,False)
window=newtree.get_object("wcancel_job_dialog")
window.show()
value=window.run()
window.hide()
window.destroy()
if value!=-5: # no
return True
self.runner.cancel()
self.runner.wait_end()
gobject.source_remove(self.timer)
self.window.hide()
self.window.destroy()
newtree=devede_other.create_tree(self,"waborted_dialog",self.gladefile,False)
window=newtree.get_object("waborted_dialog")
window.show()
window.run()
window.hide()
window.destroy()
window=None
gc.collect()
(self.main_window_callback)() # show the main window
return True
def iso_changed(self,args,arbol):
iso_name=arbol.get_object("iso_filename")
iso_folder=arbol.get_object("final_directory")
w=arbol.get_object("button_folder_accept")
mode=True
if iso_name.get_text()=="":
mode=False
folder=iso_folder.get_current_folder()
if folder==None:
mode=False
elif folder=="":
mode=False
w.set_sensitive(mode)
def check_free_space(self,filefolder,structure,actions,erase_temporary_files,sound_duration):
""" Returns TRUE if the free space in FILEFOLDER is insuficient to generate
the disk STRUCTURE """
# TODO Windows Stuff
estado=''
freespace=''
if (sys.platform!="win32") and (sys.platform!="win64"):
print "Checking "+str(filefolder)
estado=os.statvfs(filefolder) # eg. f="C:\Documents and Settings\User name\Desktop"
freespace=95*estado.f_bsize*estado.f_bavail/100000
else:
try:
test_drive = os.path.splitdrive(filefolder)[0] + "\\" # So it will also work on Windows 2000
spc, bps, fc, tc = win32api.GetDiskFreeSpace(test_drive)
freespace=fc * spc * bps
except ImportError:
pass
print "Free space in "+str(filefolder)+": "+str(freespace)
print "estatus ", estado, "\n"
total=devede_other.calcula_tamano_total(structure,sound_duration,self.disk_type)
print "Free: "+str(freespace)
print "Needed: "+str(total)
if (actions!=3):
total*=actions # if we only create the MPEG files or the DVD structure...
else:
if erase_temporary_files: # or if we create the ISO image
total*=2
else:
total*=3
total*=1.1 # a safe margin of 10%
if (freespace