Now deletes only the bare minimum needed to be able to create a new disk
Fixed a little bug that prevented to use devede when the user-choosen backend is not installed and devede tries to use another one
This commit is contained in:
parent
be34851f32
commit
325cfcc22f
2 changed files with 23 additions and 3 deletions
|
|
@ -226,8 +226,8 @@ class converter:
|
|||
return self.converters[self.config.film_converter]
|
||||
# if not, return the first available converter that supports the current disc type
|
||||
for converter in self.converters:
|
||||
if converter.disc_types.count(self.config.disc_type) != 0:
|
||||
return converter
|
||||
if self.converters[converter].disc_types.count(self.config.disc_type) != 0:
|
||||
return self.converters[converter]
|
||||
return None
|
||||
|
||||
def get_disc_converter_by_name(self,name):
|
||||
|
|
|
|||
|
|
@ -412,7 +412,27 @@ class devede_project:
|
|||
ask_w = devede.ask.ask_window()
|
||||
retval = ask_w.run(_("The selected folder already exists. To create the project, Devede must delete it.\nIf you continue, the folder\n\n <b>%s</b>\n\n and all its contents <b>will be deleted</b>. Continue?") % data.path,_("Delete folder"))
|
||||
if retval:
|
||||
shutil.rmtree(data.path,True)
|
||||
# delete only the bare minimun needed
|
||||
shutil.rmtree(os.path.join(data.path,"dvd_tree"),True)
|
||||
print("Delete "+str(os.path.join(data.path,"dvd_tree")))
|
||||
shutil.rmtree(os.path.join(data.path,"menu"),True)
|
||||
shutil.rmtree(os.path.join(data.path,"movies"),True)
|
||||
shutil.rmtree(os.path.join(data.path,"xml_data"),True)
|
||||
shutil.rmtree(os.path.join(data.path,data.name),True)
|
||||
if self.config.disc_type == "dvd":
|
||||
try:
|
||||
os.unlink(os.path.join(data.path,data.name+".iso"))
|
||||
except:
|
||||
pass
|
||||
if (self.config.disc_type == "vcd") or (self.config.disc_type == "svcd") or (self.config.disc_type == "cvd"):
|
||||
try:
|
||||
os.unlink(os.path.join(data.path,data.name+".bin"))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
os.unlink(os.path.join(data.path,data.name+".cue"))
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue