Hopefully made safe_call() more pythonic.

This commit is contained in:
Michael Lazar
2015-04-13 01:01:18 -07:00
parent fa63247f5f
commit 3f04347886
3 changed files with 42 additions and 33 deletions

View File

@@ -115,14 +115,15 @@ class SubmissionPage(BasePage):
show_notification(self.stdscr, ['Aborted'])
return
with self.safe_call():
with self.safe_call as s:
with self.loader(message='Posting', delay=0):
if data['type'] == 'Submission':
data['object'].add_comment(comment_text)
else:
data['object'].reply(comment_text)
time.sleep(2.0)
self.refresh_content()
s.catch = False
self.refresh_content()
@SubmissionController.register('d')
def delete_comment(self):