Commit c9ca82bd authored by Neel Kant's avatar Neel Kant
Browse files

Add indexer_utils

parent c150c48b
INDEX_COM_FILE = 'ready.index'
MODEL_COM_FILE = 'ready.model'
def set_index_com_file_not_ready():
with open(INDEX_COM_FILE, 'w') as com_file:
com_file.write('0')
def set_index_com_file_ready():
with open(INDEX_COM_FILE, 'w') as com_file:
com_file.write('1')
def check_index_com_file_ready():
if not os.path.exists(INDEX_COM_FILE):
set_index_com_file_not_ready()
with open(INDEX_COM_FILE, 'r') as com_file:
return bool(com_file.readline())
def set_model_com_file_not_ready():
with open(MODEL_COM_FILE, 'w') as com_file:
com_file.write('0')
def set_model_com_file_ready():
with open(MODEL_COM_FILE, 'w') as com_file:
com_file.write('1')
def check_model_com_file_ready():
if not os.path.exists(MODEL_COM_FILE):
set_index_com_file_not_ready()
with open(MODEL_COM_FILE, 'r') as com_file:
return bool(com_file.readline())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment