Fix packaging names
This commit is contained in:
parent
85df574d3c
commit
e5fa49ad53
24 changed files with 24 additions and 24 deletions
|
@ -1,48 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from datetime import datetime
|
||||
import shutil
|
||||
import os
|
||||
|
||||
|
||||
class Application:
|
||||
|
||||
def __init__(self, config, compress, printer, utils):
|
||||
self.config = config.config
|
||||
self.args = config.args
|
||||
self.compress = compress.compress
|
||||
self.printer = printer
|
||||
self.utils = utils
|
||||
|
||||
def compress_worker(self, folder, file, source, output):
|
||||
if os.path.isfile(f'{folder}/{file}'):
|
||||
self.compress(folder, file, source, output)
|
||||
|
||||
def run(self):
|
||||
start_time = datetime.now()
|
||||
self.printer.win_ascii_esc()
|
||||
|
||||
source = os.path.abspath(self.args.source)
|
||||
|
||||
if os.path.exists(f"{source}_compressed"):
|
||||
shutil.rmtree(f"{source}_compressed")
|
||||
|
||||
self.printer.info("Creating folders...")
|
||||
for folder, folders, files in os.walk(source):
|
||||
if not os.path.exists(folder.replace(source, f"{source}_compressed")):
|
||||
os.mkdir(folder.replace(source, f"{source}_compressed"))
|
||||
|
||||
self.printer.info(f'Compressing "{folder.replace(source, os.path.split(source)[-1])}" folder...')
|
||||
output = folder.replace(source, f"{source}_compressed")
|
||||
|
||||
with ThreadPoolExecutor(max_workers=self.config["FFMPEG"]["Workers"]) as executor:
|
||||
futures = [
|
||||
executor.submit(self.compress, folder, file, source, output)
|
||||
for file in files if os.path.isfile(f'{folder}/{file}')
|
||||
]
|
||||
for future in as_completed(futures):
|
||||
future.result()
|
||||
|
||||
self.utils.get_compression_status(source)
|
||||
self.utils.sys_pause()
|
||||
print(f"Time taken: {datetime.now() - start_time}")
|
Loading…
Add table
Add a link
Reference in a new issue