mirror of
https://git.srhtnin.garden/sarah/SaraSortd.git
synced 2026-10-13 18:38:11 +02:00
Removed Running, since it's very ineffective.
This commit is contained in:
1 parent
8ffcaadba5
commit
bf454bf09b
2 files changed
+22
-17
No files matched your search
+1
-1
@@ -1,5 +1,4 @@
|
||||
Title = "SaraSortd Config"
|
||||
Running = 0
|
||||
SafeMode = 1
|
||||
SilentMode = 0
|
||||
CheckInput = 3
|
||||
@@ -35,6 +34,7 @@ DirConfName = ".@Config"
|
||||
All = "[h]:[n]:[s] | "
|
||||
Start = "Started SaraSortd."
|
||||
NotStart = "Error: Failed to start SaraSortd."
|
||||
Stop = "\nStopped SaraSortd."
|
||||
MatchPattern = "Checking %%."
|
||||
Sorted = "Sorted %%."
|
||||
NotSorted = "Error: Failed to sort %%. No valid output directory."
|
||||
|
||||
+21
-16
@@ -311,7 +311,6 @@ def Init():
|
||||
LogWrite(TextOutput)
|
||||
Speak(TextOutput)
|
||||
|
||||
UpdateConf(ConfPath, "Running", 1)
|
||||
Main()
|
||||
|
||||
else:
|
||||
@@ -327,24 +326,30 @@ def Main():
|
||||
for Output in ConfDirs["OutputDir"]:
|
||||
Output = Parse(String = Output)
|
||||
Dir(Output)
|
||||
|
||||
try:
|
||||
while True:
|
||||
for Input in ConfDirs["InputDir"]:
|
||||
InputPath = Parse(Input)
|
||||
|
||||
if not os.path.exists(InputPath):
|
||||
continue
|
||||
|
||||
while (GetConf("Running", ConfPath) == 1):
|
||||
for Input in ConfDirs["InputDir"]:
|
||||
InputPath = Parse(Input)
|
||||
|
||||
if not os.path.exists(InputPath):
|
||||
continue
|
||||
for FileName in os.listdir(InputPath):
|
||||
FilePath = os.path.join(InputPath, FileName)
|
||||
|
||||
for FileName in os.listdir(InputPath):
|
||||
FilePath = os.path.join(InputPath, FileName)
|
||||
if os.path.isfile(FilePath):
|
||||
FileName = os.path.basename(FilePath)
|
||||
if (FileName.startswith(".") and Conf["DotFiles"] == 0):
|
||||
continue
|
||||
Sort(FilePath)
|
||||
|
||||
time.sleep(Conf.get("CheckInput", 10))
|
||||
|
||||
if os.path.isfile(FilePath):
|
||||
FileName = os.path.basename(FilePath)
|
||||
if (FileName.startswith(".") and Conf["DotFiles"] == 0):
|
||||
continue
|
||||
Sort(FilePath)
|
||||
|
||||
time.sleep(Conf.get("CheckInput", 10))
|
||||
except KeyboardInterrupt:
|
||||
TextOutput = GetConf("Stop", ConfPath)
|
||||
LogWrite(TextOutput)
|
||||
Speak(TextOutput)
|
||||
|
||||
|
||||
Init()
|
||||
Reference in new issue
Block a user