You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
854 B

# -*- coding: UTF-8 -*-
#!/usr/bin/env python
import os, sys
from package import search
def ScanRecoverFile():
ScanResult =[]
if os.path.exists('./recovers.txt'):
with open('./recovers.txt') as f:
ScanResult =f.read().split("\n")
else:
print("Файла со список рекомедации нейдлено")
res = GenRecoversFun(ScanResult)
return res
def GenRecoversFun(Reclist):
result ={}
cat= ""
for r in Reclist:
if r.startswith("["):
cat = r.replace("[", "") and r.replace("]", "")
result[r.replace("[", "") and r.replace("]", "")]= []
else:
try:
result[cat].append(search(r))
except Exception as e:
print(e)
return result
if __name__ == '__main__':
ScanRecoverFile()