def api_schedule(): try: global Global a = Global['MyAgent'](request) s = Schedule(a) return (jsonify({'check': True, 'html': s.ToHtml()})) except: TB.print_exc() return (jsonify({'check': False}))