# Path: matcher/view.py
# def set_url_args(**new_args):
# def newline_br(eval_ctx, value):
# def demo_mode():
# def global_user():
# def site_banner():
# def slow_crawl():
# def load_user(user_id):
# def navbar():
# def login_route():
# def dev_login():
# def login_openstreetmap():
# def logout():
# def done():
# def start_oauth():
# def oauth_callback():
# def reraise(tp, value, tb=None):
# def requests_exception(e):
# def query_error(e):
# def exception_handler(e):
# def get_osm_object(osm_type, osm_id, attempts=5):
# def add_wikidata_tag():
# def wikidata_page(osm_type, osm_id):
# def overpass_query(osm_type, osm_id):
# def save_timing(name, t0):
# def update_tags(osm_type, osm_id):
# def add_tags_post(osm_type, osm_id):
# def add_tags(osm_type, osm_id):
# def place_redirect(name):
# def get_bad_matches(place):
# def get_wikidata_language(code):
# def set_top_language(place, top):
# def switch_languages(osm_type, osm_id):
# def read_language_order():
# def languages_in_user_order(user_language_order, languages):
# def get_place_language_with_counts(place):
# def get_place_language(place):
# def save_language_order(osm_type, osm_id):
# def clear_languard_cookie():
# def debug_languages():
# def mobile(osm_type, osm_id):
# def check_still_auth():
# def debug_user_details():
# def export_place(osm_type, osm_id):
# def redirect_to_candidates(osm_type, osm_id):
# def redirect_from_relation(osm_id):
# def redirect_from_way(osm_id):
# def profile_candidates(osm_type, osm_id):
#     def record_timing(name):
# def candidates(osm_type, osm_id):
# def language_dict(lang):
# def identifier_match(key, osm_value, identifiers):
# def candidate_tags(search_tags, identifiers, candidate):
# def candidate_language_order(osm_type, osm_id):
# def candidates_json(osm_type, osm_id):
# def old_candidates(osm_type, osm_id):
# def test_candidates(osm_type, osm_id):
# def get_place(osm_type, osm_id):
# def no_match(osm_type, osm_id):
# def already_tagged(osm_type, osm_id):
# def node_is_in(osm_id):
# def refresh_place(osm_type, osm_id):
# def get_existing(sort, name_filter):
# def sort_link(order):
# def add_hit_place_detail(hit):
# def random_city():
# def search_results():
# def instance_of_page(item_id):
# def index():
# def criteria_page():
# def documentation():
# def changesets():
# def browse_index():
# def browse_page(item_id):
# def matcher_wikidata(item_id):
#     def get_search_string(qid):
# def get_tag_list(sort):
# def tag_list():
# def tag_page(tag_or_key):
# def bad_match(item_id, osm_type, osm_id):
# def match_detail(item_id, osm_type, osm_id):
# def build_item_page(wikidata_id, item):
# def item_page(wikidata_id):
# def reports_view():
# def isa_list_report():
# def isa_item_report(isa_id):
# def isa_item_refresh(isa_id):
# def old_places():
# def delete_place(place_id):
# def delete_places():
# def account_page():
# def account_settings_page():
# def item_candidate_json(item_id):
# def single_item_match(osm_type, osm_id, item_id):
# 
# Path: matcher/database.py
# def init_db(db_url):
# def get_engine(db_url, echo=False):
# def get_tables():
# def init_app(app, echo=False):
#     def shutdown_session(exception=None):
# def get_old_place_list():
# def get_big_table_list():
# def now_utc():
# 
# Path: matcher/error_mail.py
# def setup_error_mail(app):
#     if not app.config.get('ERROR_MAIL'):
#         return
#     formatter = RequestFormatter('''
#     Message type:       {levelname}
#     Location:           {pathname:s}:{lineno:d}
#     Module:             {module:s}
#     Function:           {funcName:s}
#     Time:               {asctime:s}
#     GET args:           {request.args!r}
#     URL:                {request.url}
# 
#     Message:
# 
#     {message:s}
#     ''', style='{')
# 
#     mail_handler = MatcherSMTPHandler(app.config['SMTP_HOST'],
#                                       app.config['MAIL_FROM'],
#                                       app.config['ADMINS'],
#                                       app.name + ' error')
#     mail_handler.setFormatter(formatter)
# 
#     mail_handler.setLevel(logging.ERROR)
#     app.logger.propagate = True
#     app.logger.addHandler(mail_handler)


from matcher.view import app
from matcher import database
from matcher.error_mail import setup_error_mail
from flask_debugtoolbar import DebugToolbarExtension
#!/usr/bin/python3

# from werkzeug.debug import DebuggedApplication
# from werkzeug.serving import run_simple

if __name__ == "__main__":
    app.config.from_object('config.default')
    database.init_app(app)
    setup_error_mail(app)
    app.debug = False
    app.debug = True
    toolbar = DebugToolbarExtension(app)
    # debug_app = DebuggedApplication(app, evalex=False)


# Path: matcher/view.py
# def set_url_args(**new_args):
# def newline_br(eval_ctx, value):
# def demo_mode():
# def global_user():
# def site_banner():
# def slow_crawl():
# def load_user(user_id):
# def navbar():
# def login_route():
# def dev_login():
# def login_openstreetmap():
# def logout():
# def done():
# def start_oauth():
# def oauth_callback():
# def reraise(tp, value, tb=None):
# def requests_exception(e):
# def query_error(e):
# def exception_handler(e):
# def get_osm_object(osm_type, osm_id, attempts=5):
# def add_wikidata_tag():
# def wikidata_page(osm_type, osm_id):
# def overpass_query(osm_type, osm_id):
# def save_timing(name, t0):
# def update_tags(osm_type, osm_id):
# def add_tags_post(osm_type, osm_id):
# def add_tags(osm_type, osm_id):
# def place_redirect(name):
# def get_bad_matches(place):
# def get_wikidata_language(code):
# def set_top_language(place, top):
# def switch_languages(osm_type, osm_id):
# def read_language_order():
# def languages_in_user_order(user_language_order, languages):
# def get_place_language_with_counts(place):
# def get_place_language(place):
# def save_language_order(osm_type, osm_id):
# def clear_languard_cookie():
# def debug_languages():
# def mobile(osm_type, osm_id):
# def check_still_auth():
# def debug_user_details():
# def export_place(osm_type, osm_id):
# def redirect_to_candidates(osm_type, osm_id):
# def redirect_from_relation(osm_id):
# def redirect_from_way(osm_id):
# def profile_candidates(osm_type, osm_id):
#     def record_timing(name):
# def candidates(osm_type, osm_id):
# def language_dict(lang):
# def identifier_match(key, osm_value, identifiers):
# def candidate_tags(search_tags, identifiers, candidate):
# def candidate_language_order(osm_type, osm_id):
# def candidates_json(osm_type, osm_id):
# def old_candidates(osm_type, osm_id):
# def test_candidates(osm_type, osm_id):
# def get_place(osm_type, osm_id):
# def no_match(osm_type, osm_id):
# def already_tagged(osm_type, osm_id):
# def node_is_in(osm_id):
# def refresh_place(osm_type, osm_id):
# def get_existing(sort, name_filter):
# def sort_link(order):
# def add_hit_place_detail(hit):
# def random_city():
# def search_results():
# def instance_of_page(item_id):
# def index():
# def criteria_page():
# def documentation():
# def changesets():
# def browse_index():
# def browse_page(item_id):
# def matcher_wikidata(item_id):
#     def get_search_string(qid):
# def get_tag_list(sort):
# def tag_list():
# def tag_page(tag_or_key):
# def bad_match(item_id, osm_type, osm_id):
# def match_detail(item_id, osm_type, osm_id):
# def build_item_page(wikidata_id, item):
# def item_page(wikidata_id):
# def reports_view():
# def isa_list_report():
# def isa_item_report(isa_id):
# def isa_item_refresh(isa_id):
# def old_places():
# def delete_place(place_id):
# def delete_places():
# def account_page():
# def account_settings_page():
# def item_candidate_json(item_id):
# def single_item_match(osm_type, osm_id, item_id):
# 
# Path: matcher/database.py
# def init_db(db_url):
# def get_engine(db_url, echo=False):
# def get_tables():
# def init_app(app, echo=False):
#     def shutdown_session(exception=None):
# def get_old_place_list():
# def get_big_table_list():
# def now_utc():
# 
# Path: matcher/error_mail.py
# def setup_error_mail(app):
#     if not app.config.get('ERROR_MAIL'):
#         return
#     formatter = RequestFormatter('''
#     Message type:       {levelname}
#     Location:           {pathname:s}:{lineno:d}
#     Module:             {module:s}
#     Function:           {funcName:s}
#     Time:               {asctime:s}
#     GET args:           {request.args!r}
#     URL:                {request.url}
# 
#     Message:
# 
#     {message:s}
#     ''', style='{')
# 
#     mail_handler = MatcherSMTPHandler(app.config['SMTP_HOST'],
#                                       app.config['MAIL_FROM'],
#                                       app.config['ADMINS'],
#                                       app.name + ' error')
#     mail_handler.setFormatter(formatter)
# 
#     mail_handler.setLevel(logging.ERROR)
#     app.logger.propagate = True
#     app.logger.addHandler(mail_handler)


# Path: run.py
from matcher.view import app
from matcher import database
from matcher.error_mail import setup_error_mail
from flask_debugtoolbar import DebugToolbarExtension

#!/usr/bin/python3

# from werkzeug.debug import DebuggedApplication
# from werkzeug.serving import run_simple

if __name__ == "__main__":
    app.config.from_object('config.default')
    database.init_app(app)
    setup_error_mail(app)
    app.debug = False
    app.debug = True
    toolbar = DebugToolbarExtension(app)
    # debug_app = DebuggedApplication(app, evalex=False)


    app.run(port=5001)