fixed empty todo management
parent
f93e5b7f70
commit
852a0e05db
11
silojourn.py
11
silojourn.py
|
@ -223,7 +223,11 @@ class Journaler():
|
|||
# open self.config.tracker file
|
||||
# iterate through lines
|
||||
# find line that begins with hash
|
||||
with open( self.config.tracker, 'w+' ) as tracker_file:
|
||||
if not os.path.exists( self.config.tracker ):
|
||||
f = open(self.config.tracker, 'w+')
|
||||
f.close()
|
||||
|
||||
with open( self.config.tracker, 'r' ) as tracker_file:
|
||||
for line in tracker_file:
|
||||
m = re.search( "^{0}\t.*$".format( task.hash ), line )
|
||||
print(line)
|
||||
|
@ -253,6 +257,8 @@ class Journaler():
|
|||
( todo.hash, "({0}) {1}".format(todo.topic, todo.text) , False )
|
||||
)
|
||||
|
||||
|
||||
if len(choices) > 0:
|
||||
code, hashes_marked_complete = self.d.checklist(
|
||||
text="TODO Entries",
|
||||
choices=choices,
|
||||
|
@ -277,6 +283,9 @@ class Journaler():
|
|||
|
||||
for selection in tasks_to_complete:
|
||||
self._mark_task_complete( selection )
|
||||
else:
|
||||
# no todo items
|
||||
self.do_browse_topics()
|
||||
|
||||
def create_new_topic_ui(self):
|
||||
input_code, input_topic = self.d.inputbox("Creating a new topic for today: {}".format(self._get_current_date()),
|
||||
|
|
Loading…
Reference in New Issue