import traceback
import sys
from flask import Response
from flask_restful import Resource, reqparse
import json
from controller.controller import controller


class Login(Resource):
    """Login-API deserializes JSON and hands it to the Authentication class of authentication module"""
    def post(self):
        parser = reqparse.RequestParser()
        parser.add_argument("username", type=str)
        parser.add_argument("password", type=str)
        args = parser.parse_args()
        try:
            message = json.dumps(controller.login(args["username"], args["password"]))
            return Response(message, status=200, mimetype="application/json")
        except AttributeError:
            tb = traceback.format_exc()
            print(tb, file=sys.stderr)
            return Response(status=400)
        except TimeoutError:
            return Response(status=504)
        except Exception:
            traceback.print_exc()
            return Response(status=520)

    def options(self):
        pass

c29a3d20ff8816474ac68517c771f80c10450205
<mask token>


class Login(Resource):
    <mask token>
    <mask token>

    def options(self):
        pass

<mask token>


class Login(Resource):
    <mask token>

    def post(self):
        parser = reqparse.RequestParser()
        parser.add_argument('username', type=str)
        parser.add_argument('password', type=str)
        args = parser.parse_args()
        try:
            message = json.dumps(controller.login(args['username'], args[
                'password']))
            return Response(message, status=200, mimetype='application/json')
        except AttributeError:
            tb = traceback.format_exc()
            print(tb, file=sys.stderr)
            return Response(status=400)
        except TimeoutError:
            return Response(status=504)
        except Exception:
            traceback.print_exc()
            return Response(status=520)

    def options(self):
        pass

<mask token>


class Login(Resource):
    """Login-API deserializes JSON and hands it to the Authentication class of authentication module"""

    def post(self):
        parser = reqparse.RequestParser()
        parser.add_argument('username', type=str)
        parser.add_argument('password', type=str)
        args = parser.parse_args()
        try:
            message = json.dumps(controller.login(args['username'], args[
                'password']))
            return Response(message, status=200, mimetype='application/json')
        except AttributeError:
            tb = traceback.format_exc()
            print(tb, file=sys.stderr)
            return Response(status=400)
        except TimeoutError:
            return Response(status=504)
        except Exception:
            traceback.print_exc()
            return Response(status=520)

    def options(self):
        pass

import traceback
import sys
from flask import Response
from flask_restful import Resource, reqparse
import json
from controller.controller import controller


class Login(Resource):
    """Login-API deserializes JSON and hands it to the Authentication class of authentication module"""

    def post(self):
        parser = reqparse.RequestParser()
        parser.add_argument('username', type=str)
        parser.add_argument('password', type=str)
        args = parser.parse_args()
        try:
            message = json.dumps(controller.login(args['username'], args[
                'password']))
            return Response(message, status=200, mimetype='application/json')
        except AttributeError:
            tb = traceback.format_exc()
            print(tb, file=sys.stderr)
            return Response(status=400)
        except TimeoutError:
            return Response(status=504)
        except Exception:
            traceback.print_exc()
            return Response(status=520)

    def options(self):
        pass

import traceback
import sys
from flask import Response
from flask_restful import Resource, reqparse
import json
from controller.controller import controller


class Login(Resource):
    """Login-API deserializes JSON and hands it to the Authentication class of authentication module"""
    def post(self):
        parser = reqparse.RequestParser()
        parser.add_argument("username", type=str)
        parser.add_argument("password", type=str)
        args = parser.parse_args()
        try:
            message = json.dumps(controller.login(args["username"], args["password"]))
            return Response(message, status=200, mimetype="application/json")
        except AttributeError:
            tb = traceback.format_exc()
            print(tb, file=sys.stderr)
            return Response(status=400)
        except TimeoutError:
            return Response(status=504)
        except Exception:
            traceback.print_exc()
            return Response(status=520)

    def options(self):
        pass
