예제 #1
0
import logging
import os

from flask_restplus import Api as _Api
# from flask_restplus import reqparse as _reqparse
# from werkzeug.exceptions import HTTPException

log = logging.getLogger(__name__)

v = os.popen('git log | head -n 1')
commit = v.read().replace("commit ", "")[:7]

api = _Api(version='0.1#{}'.format(commit),
           default='',
           title='Exemplo CRUD',
           description='CRUD')
예제 #2
0
import logging
import os

from flask_restplus import Api as _Api

log = logging.getLogger(__name__)

v = os.popen('git log | head -n 1')
commit = v.read().replace("commit ", "")[:7]

api = _Api(version='0.1#{}'.format(commit),
           default='',
           title='Find Zen Quotes',
           description='Quotes')
예제 #3
0
from flask_restplus import Api as _Api

api = _Api(version="0.1", title="API Robot Gmail",
           description="Esta API executa um Robot que loga em uma conta gmail e dispara um e-mail.")
예제 #4
0
import logging
import os
from jsonschema import FormatChecker

from flask_restplus import Api as _Api
from werkzeug.exceptions import HTTPException

log = logging.getLogger(__name__)

v = os.popen('git log | head -n 1')
commit = v.read().replace("commit ", "")[:7]

api = _Api(version='0.1#{}'.format(commit),
           default='',
           doc='/docs',
           title='Maju Playlist',
           description='',
           format_checker=FormatChecker())


@api.errorhandler
def default_error_handler(e):
    if isinstance(e, HTTPException):
        response = {'message': e.description}
        status_code = e.code
    else:
        response = {'message': 'Unhandled Exception'}
        status_code = 500

    log.exception(e)
    return response, status_code
예제 #5
0
import logging
import os

from flask_restplus import Api as _Api
from flask_restplus import reqparse as _reqparse
from werkzeug.exceptions import HTTPException

log = logging.getLogger(__name__)

v = os.popen('git log | head -n 1')
commit = v.read().replace("commit ", "")[:7]

api = _Api(version='0.1#{}'.format(commit), default='',
           title='Covid Tracker', description='Monitoramento de casos do COVID no Brasil.')
예제 #6
0
import logging
import os

from flask_restplus import Api as _Api
from jsonschema import FormatChecker
from werkzeug.exceptions import HTTPException

log = logging.getLogger(__name__)

v = os.popen('git log | head -n 1')
commit = v.read().replace("commit ", "")[:7]

api = _Api(version='0.1#{}'.format(commit),
           default='',
           doc='/docs',
           title='Client Manager',
           description='',
           format_checker=FormatChecker())

@api.errorhandler
def default_error_handler(e):
    if isinstance(e, HTTPException):
        response = {'message': e.description}
        status_code = e.code
    else:
        response = {'message': 'Unhandled Exception'}
        status_code = 500

    log.exception(e)
    return response, status_code
예제 #7
0
import logging
import os

from flask_restplus import Api as _Api
from flask_restplus import reqparse as _reqparse

log = logging.getLogger(__name__)

v = os.popen('git log | head -n 1')
commit = v.read().replace("commit ", "")[:7]

api = _Api(version='0.1#{}'.format(commit),
           default='',
           title='Zen of Python List',
           description='Zen of Python')
예제 #8
0
import logging
import os
from jsonschema import FormatChecker

from flask_restplus import Api as _Api
from werkzeug.exceptions import HTTPException

log = logging.getLogger(__name__)

v = os.popen('git log | head -n 1')
commit = v.read().replace("commit ", "")[:7]

api = _Api(version='0.1#{}'.format(commit),
           default='',
           doc='/docs',
           title='John Brave Cane',
           description='',
           format_checker=FormatChecker())


@api.errorhandler
def default_error_handler(e):
    if isinstance(e, HTTPException):
        response = {'message': e.description}
        status_code = e.code
    else:
        response = {'message': 'Unhandled Exception'}
        status_code = 500

    log.exception(e)
    return response, status_code
예제 #9
0
import logging
import os

from flask_restplus import Api as _Api
from flask_restplus import reqparse as _reqparse
from werkzeug.exceptions import HTTPException

log = logging.getLogger(__name__)

v = os.popen('git log | head -n 1')
commit = v.read().replace("commit ", "")[:7]

api = _Api(version='0.1#{}'.format(commit),
           default='',
           title='Lectures',
           description='')