clean up and org
This commit is contained in:
23
dmapp/dmcore/task.py
Normal file
23
dmapp/dmcore/task.py
Normal file
@@ -0,0 +1,23 @@
|
||||
task_file = "/home/mariano/LETRAS/org/task/main"
|
||||
|
||||
|
||||
def extract(line):
|
||||
if line.rstrip().endswith("*"):
|
||||
pipe_index = line.find("|")
|
||||
if pipe_index != -1 and len(line) > pipe_index + 8:
|
||||
value = line[pipe_index + 1 : pipe_index + 9]
|
||||
return value
|
||||
return None
|
||||
|
||||
|
||||
def read_and_extract(file_path):
|
||||
with open(file_path, "r") as file:
|
||||
for line in file:
|
||||
value = extract(line)
|
||||
if value:
|
||||
return value
|
||||
return None
|
||||
|
||||
|
||||
def current():
|
||||
return read_and_extract(task_file)
|
||||
Reference in New Issue
Block a user