Fix bug with empty description

This commit is contained in:
2018-03-07 18:56:08 -08:00
parent 1b174219d5
commit c97f79a081
2 changed files with 6 additions and 3 deletions

View File

@@ -39,7 +39,11 @@ class Task(AsanaObject):
parser = HTMLTextParser()
parser.feed(self.object_dict['html_notes'])
parser.close()
return parser.get_formatted_text()
text = parser.get_formatted_text()
if (len(text) > 0):
return text
else:
return ""
elif 'notes' in self.object_dict:
return self.object_dict['notes']
else:
@@ -166,7 +170,6 @@ class HTMLTextParser(HTMLParser):
def get_formatted_text(self):
formatted = [t.text_format() for t in self.text]
print(formatted, file=sys.stderr)
return formatted

View File

@@ -38,7 +38,7 @@ class MyTasks(object):
] + [TaskRow(t, self.callback) for t in self.today] + [
urwid.Text(('atm_section', 'Upcoming'))
] + [TaskRow(t, self.callback) for t in self.upcoming] + [
urwid.Text(('atm_section', 'Upcoming'))
urwid.Text(('atm_section', 'Later'))
] + [TaskRow(t, self.callback) for t in self.later]
)
),