mpegize: force to remove non-empty subdirectories
os.rmdir doesn't remove non-empty directories. m.base/sm subdirectory contains audio-samples, that were not removed after video is created.
This commit is contained in:

committed by
Martijn Braam

parent
978680e5c6
commit
8282b4eaca
@@ -2,6 +2,7 @@
|
|||||||
# Copyright 2022, 2024 Pavel Machek, GPLv2+
|
# Copyright 2022, 2024 Pavel Machek, GPLv2+
|
||||||
|
|
||||||
import os, sys, time, copy, subprocess
|
import os, sys, time, copy, subprocess
|
||||||
|
import shutil
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Gst', '1.0')
|
gi.require_version('Gst', '1.0')
|
||||||
from gi.repository import Gst, GLib
|
from gi.repository import Gst, GLib
|
||||||
@@ -418,8 +419,7 @@ class Mpegize:
|
|||||||
print("mpegize command base-dir destination-movie fps dng|grw")
|
print("mpegize command base-dir destination-movie fps dng|grw")
|
||||||
|
|
||||||
def cleanup(m):
|
def cleanup(m):
|
||||||
os.rmdir(m.base+"/sm/")
|
shutil.rmtree(m.base)
|
||||||
os.rmdir(m.base)
|
|
||||||
print("Message: Rec")
|
print("Message: Rec")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user