Fixed RET functionnality misbehaviour

This commit is contained in:
2020-07-08 13:35:18 +02:00
parent c4399d631c
commit b768eaa95d
14 changed files with 113 additions and 29 deletions
+8 -3
View File
@@ -3,7 +3,8 @@ import time
from core.builtin_concepts import BuiltinConcepts
from core.sheerka.services.sheerka_service import BaseService
CONCEPTS_FILE = "_concepts.txt"
CONCEPTS_FILE = "_concepts_lite.txt"
CONCEPTS_FILE_ALL_CONCEPTS = "_concepts.txt"
class SheerkaAdmin(BaseService):
@@ -37,15 +38,19 @@ class SheerkaAdmin(BaseService):
return self.sheerka.cache_manager.caches[name].cache.copy()
def restore(self):
def restore(self, concept_file=CONCEPTS_FILE):
"""
Restore the state with all previous valid concept definitions
:return:
"""
if concept_file == "full":
concept_file = CONCEPTS_FILE_ALL_CONCEPTS
try:
start = time.time_ns()
self.sheerka.during_restore = True
with open(CONCEPTS_FILE, "r") as f:
with open(concept_file, "r") as f:
for line in f.readlines():
line = line.strip()
if line == "" or line.startswith("#"):