def generate_view_rtm(feedback_items): # check if have RTM enabled if rtm.is_enabled(): # not authenticated, and not started on if not rtm.is_authenticated(): if not rtm.auth_in_progress() or rtm.auth_outdated(): # add option to initiate auth feedback_items.append(generate_action_feedback( title='[Authorize Todo]', subtitle='Allow Todo to access your lists and tasks on RTM', icon='rtm.png', action='action.rtm.init_auth' )) else: feedback_items.append(generate_action_feedback( title='[Load Lists]', subtitle='Once you have authorized Todo in your browser, select this option', icon='rtm.png', action='action.rtm.end_auth' )) else: # utility to force a refresh of all items feedback_items.append(generate_action_feedback( title='[Refresh Lists]', icon='rtm.png', action='action.rtm.refresh' )) return True return False
def is_supported_file(_file): for f in supported_formats: if _file.endswith(f): if f=='.rtm-todolist': return rtm.is_enabled() and rtm.is_authenticated() return True return False