mirror of
https://git.srhtnin.garden/sarah/SaraSortd.git
synced 2026-10-15 10:53:17 +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"
|
Title = "SaraSortd Config"
|
||||||
Running = 0
|
|
||||||
SafeMode = 1
|
SafeMode = 1
|
||||||
SilentMode = 0
|
SilentMode = 0
|
||||||
CheckInput = 3
|
CheckInput = 3
|
||||||
@@ -35,6 +34,7 @@ DirConfName = ".@Config"
|
|||||||
All = "[h]:[n]:[s] | "
|
All = "[h]:[n]:[s] | "
|
||||||
Start = "Started SaraSortd."
|
Start = "Started SaraSortd."
|
||||||
NotStart = "Error: Failed to start SaraSortd."
|
NotStart = "Error: Failed to start SaraSortd."
|
||||||
|
Stop = "\nStopped SaraSortd."
|
||||||
MatchPattern = "Checking %%."
|
MatchPattern = "Checking %%."
|
||||||
Sorted = "Sorted %%."
|
Sorted = "Sorted %%."
|
||||||
NotSorted = "Error: Failed to sort %%. No valid output directory."
|
NotSorted = "Error: Failed to sort %%. No valid output directory."
|
||||||
|
|||||||
+21
-16
@@ -311,7 +311,6 @@ def Init():
|
|||||||
LogWrite(TextOutput)
|
LogWrite(TextOutput)
|
||||||
Speak(TextOutput)
|
Speak(TextOutput)
|
||||||
|
|
||||||
UpdateConf(ConfPath, "Running", 1)
|
|
||||||
Main()
|
Main()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -327,24 +326,30 @@ def Main():
|
|||||||
for Output in ConfDirs["OutputDir"]:
|
for Output in ConfDirs["OutputDir"]:
|
||||||
Output = Parse(String = Output)
|
Output = Parse(String = Output)
|
||||||
Dir(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 FileName in os.listdir(InputPath):
|
||||||
for Input in ConfDirs["InputDir"]:
|
FilePath = os.path.join(InputPath, FileName)
|
||||||
InputPath = Parse(Input)
|
|
||||||
|
|
||||||
if not os.path.exists(InputPath):
|
|
||||||
continue
|
|
||||||
|
|
||||||
for FileName in os.listdir(InputPath):
|
if os.path.isfile(FilePath):
|
||||||
FilePath = os.path.join(InputPath, FileName)
|
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):
|
except KeyboardInterrupt:
|
||||||
FileName = os.path.basename(FilePath)
|
TextOutput = GetConf("Stop", ConfPath)
|
||||||
if (FileName.startswith(".") and Conf["DotFiles"] == 0):
|
LogWrite(TextOutput)
|
||||||
continue
|
Speak(TextOutput)
|
||||||
Sort(FilePath)
|
|
||||||
|
|
||||||
time.sleep(Conf.get("CheckInput", 10))
|
|
||||||
|
|
||||||
|
|
||||||
Init()
|
Init()
|
||||||
Reference in new issue
Block a user