Пример #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='')