# Path: modules/bottle_cors.py
# class CorsPlugin(object):
#     def __init__(self, allow_origin='*', preflight_methods=['GET', 'POST', 'PUT', 'DELETE']):
#     def apply(self, callback, route):
#         def wrapper(*args, **kwargs):
# 
# Path: modules/bottle_langs.py
# class LangsPlugin(object):
#     def __init__(self, keyword='langs'):
#     def parse_accept_language(self, langs):
#     def get_language(self):
#     def apply(self, callback, route):
#         def wrapper(*args, **kwargs):
# 
# Path: modules/bottle_gettext.py
# class GettextPlugin(object):
#     def __init__(self, domain, localedir, allowed_languages, keyword='lang'):
#     def get_language(self):
#     def apply(self, callback, route):
#         def wrapper(*args, **kwargs):


import bottle
import os
from modules.osmose_bottle import uuid_filter, ext_filter
from modules import utils
from modules import bottle_pgsql
from modules import bottle_cors
from modules import bottle_langs
from modules import bottle_gettext
from . import meta_0_3
from . import user
from . import issue
from . import issues
from . import issues_tiles
from . import false_positive
##                                                                       ##
## This program is distributed in the hope that it will be useful,       ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of        ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         ##
## GNU General Public License for more details.                          ##
##                                                                       ##
## You should have received a copy of the GNU General Public License     ##
## along with this program.  If not, see <http://www.gnu.org/licenses/>. ##
##                                                                       ##
###########################################################################



class OsmoseAPIBottle(bottle.Bottle):
    def default_error_handler(self, res):
        bottle.response.content_type = 'text/plain'
        return res.body

app_0_3 = OsmoseAPIBottle()
bottle.default_app.push(app_0_3)

app_0_2 = OsmoseAPIBottle()
bottle.default_app.push(app_0_2)


app_0_2.install(bottle_pgsql.Plugin(utils.db_string))
app_0_2.install(bottle_cors.Plugin(allow_origin = '*', preflight_methods = ['GET', 'POST', 'PUT', 'DELETE']))
app_0_2.install(bottle_gettext.Plugin('osmose-frontend', os.path.join("web", "po", "mo"), utils.allowed_languages))

app_0_3.install(bottle_pgsql.Plugin(utils.db_string))

# Path: modules/bottle_cors.py
# class CorsPlugin(object):
#     def __init__(self, allow_origin='*', preflight_methods=['GET', 'POST', 'PUT', 'DELETE']):
#     def apply(self, callback, route):
#         def wrapper(*args, **kwargs):
# 
# Path: modules/bottle_langs.py
# class LangsPlugin(object):
#     def __init__(self, keyword='langs'):
#     def parse_accept_language(self, langs):
#     def get_language(self):
#     def apply(self, callback, route):
#         def wrapper(*args, **kwargs):
# 
# Path: modules/bottle_gettext.py
# class GettextPlugin(object):
#     def __init__(self, domain, localedir, allowed_languages, keyword='lang'):
#     def get_language(self):
#     def apply(self, callback, route):
#         def wrapper(*args, **kwargs):


# Path: api/app.py
import bottle
import os
from modules.osmose_bottle import uuid_filter, ext_filter
from modules import utils
from modules import bottle_pgsql
from modules import bottle_cors
from modules import bottle_langs
from modules import bottle_gettext
from . import meta_0_3
from . import user
from . import issue
from . import issues
from . import issues_tiles
from . import false_positive

##                                                                       ##
## This program is distributed in the hope that it will be useful,       ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of        ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         ##
## GNU General Public License for more details.                          ##
##                                                                       ##
## You should have received a copy of the GNU General Public License     ##
## along with this program.  If not, see <http://www.gnu.org/licenses/>. ##
##                                                                       ##
###########################################################################



class OsmoseAPIBottle(bottle.Bottle):
    def default_error_handler(self, res):
        bottle.response.content_type = 'text/plain'
        return res.body

app_0_3 = OsmoseAPIBottle()
bottle.default_app.push(app_0_3)

app_0_2 = OsmoseAPIBottle()
bottle.default_app.push(app_0_2)


app_0_2.install(bottle_pgsql.Plugin(utils.db_string))
app_0_2.install(bottle_cors.Plugin(allow_origin = '*', preflight_methods = ['GET', 'POST', 'PUT', 'DELETE']))
app_0_2.install(bottle_gettext.Plugin('osmose-frontend', os.path.join("web", "po", "mo"), utils.allowed_languages))

app_0_3.install(bottle_pgsql.Plugin(utils.db_string))

app_0_3.install(bottle_cors.Plugin(allow_origin = '*', preflight_methods = ['GET', 'POST', 'PUT', 'DELETE']))