mirror of
https://git.srhtnin.garden/sarah/SaraSortd.git
synced 2026-10-14 10:48:11 +02:00
Added unzipping function, but haven't tested it yet.
This commit is contained in:
1 parent
5c39166a66
commit
2cc72b1730
5 files changed
+24
-8
No files matched your search
+14
-1
@@ -6,7 +6,7 @@ import shutil
|
||||
import time
|
||||
import toml
|
||||
|
||||
# Version = "6.3"
|
||||
# Version = "6.4"
|
||||
|
||||
ConfPath = "./GlobalConf.toml"
|
||||
|
||||
@@ -307,6 +307,19 @@ def DecideNewPath(FilePath):
|
||||
|
||||
FileLimitConf = GetConf("FileLimit", OutDirConfPath)
|
||||
|
||||
if GetConf("Unzip", OutDirConfPath) == 1:
|
||||
ZipTypes = ["zip", "tar.gz", "bz2"]
|
||||
for OutputFile in os.listdir(Output):
|
||||
if OutputFile.startswith("."):
|
||||
continue
|
||||
|
||||
for ZipType in ZipTypes:
|
||||
if OutputFile.lower().endswith(ZipType):
|
||||
shutil.unpack_archive(f"{Output}/{OutputFile}", Output, ZipType)
|
||||
TextOutput = Parse(String = ConfLog["Unzipping"], VarCall = f"{Output}/{OutputFile}")
|
||||
LogWrite(TextOutput)
|
||||
Speak(TextOutput)
|
||||
|
||||
if FileLimitConf > 0:
|
||||
for OutputFile in os.listdir(Output):
|
||||
if OutputFile.startswith("."):
|
||||
|
||||
Reference in new issue
Block a user