From f273d2abeefa0d77d306bcfab3135195afbc31c3 Mon Sep 17 00:00:00 2001 From: Lisa Junger Date: Wed, 19 Nov 2014 10:44:08 +0100 Subject: added functionality for reply all to service. --- service/pixelated/config/app_factory.py | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'service/pixelated/config') diff --git a/service/pixelated/config/app_factory.py b/service/pixelated/config/app_factory.py index ede19e60..2021556d 100644 --- a/service/pixelated/config/app_factory.py +++ b/service/pixelated/config/app_factory.py @@ -62,13 +62,40 @@ def update_info_sync_and_index_partial(sync_info_controller, search_engine, mail return wrapper +def _setup_routes(app, home_controller, mails_controller, tags_controller, features_controller, sync_info_controller, + attachments_controller): + # mails + app.route('/mails', methods=['GET'])(mails_controller.mails) + app.route('/mail//read', methods=['POST'])(mails_controller.mark_mail_as_read) + app.route('/mail//unread', methods=['POST'])(mails_controller.mark_mail_as_unread) + app.route('/mails/unread', methods=['POST'])(mails_controller.mark_many_mail_unread) + app.route('/mails/read', methods=['POST'])(mails_controller.mark_many_mail_read) + app.route('/mail/', methods=['GET'])(mails_controller.mail) + app.route('/mail//reply_all_template', methods=['GET'])(mails_controller.reply_all_template) + app.route('/mail/', methods=['DELETE'])(mails_controller.delete_mail) + app.route('/mails', methods=['DELETE'])(mails_controller.delete_mails) + app.route('/mails', methods=['POST'])(mails_controller.send_mail) + app.route('/mail//tags', methods=['POST'])(mails_controller.mail_tags) + app.route('/mails', methods=['PUT'])(mails_controller.update_draft) + # tags + app.route('/tags', methods=['GET'])(tags_controller.tags) + # features + app.route('/features', methods=['GET'])(features_controller.features) + # sync info + app.route('/sync_info', methods=['GET'])(sync_info_controller.sync_info) + # attachments + app.route('/attachment/', methods=['GET'])(attachments_controller.attachment) + # static + app.route('/', methods=['GET'], branch=True)(home_controller.home) + + def init_leap_session(app): try: leap_session = LeapSession.open(app.config['LEAP_USERNAME'], app.config['LEAP_PASSWORD'], app.config['LEAP_SERVER_NAME']) - except ConnectionError: - print("Can't connect to the requested provider") + except ConnectionError, error: + print("Can't connect to the requested provider", error) sys.exit(1) except LeapAuthException, e: print("Couldn't authenticate with the credentials provided %s" % e.message) -- cgit v1.2.3