def dispatch_request(self): update_ts_file = current_app.config["CACHE_DIR"] / "last-update" last_update = local_info.read_update_ts(update_ts_file) try: session.query(Package).first().id # database check except Exception: return jsonify(dict(status="db error", http_status_code=500)), 500 return jsonify( dict(status="ok", http_status_code=200, last_update=last_update))
def ping(): update_ts_file = os.path.join(app.config['CACHE_DIR'], 'last-update') last_update = local_info.read_update_ts(update_ts_file) try: session.query(Package).first().id # database check except: return jsonify(dict(status="db error", http_status_code=500)), 500 return jsonify(dict(status="ok", http_status_code=200, last_update=last_update))
def skeleton_variables(): update_ts_file = os.path.join(app.config['CACHE_DIR'], 'last-update') last_update = local_info.read_update_ts(update_ts_file) packages_prefixes = PackageName.get_packages_prefixes( app.config["CACHE_DIR"]) credits_file = os.path.join(app.config["LOCAL_DIR"], "credits.html") credits = local_info.read_html(credits_file) return dict(packages_prefixes=packages_prefixes, searchform=SearchForm(), last_update=last_update, credits=credits)
def skeleton_variables(): update_ts_file = os.path.join(app.config['CACHE_DIR'], 'last-update') # TODO, this part should be moved to per blueprint context processor last_update = local_info.read_update_ts(update_ts_file) packages_prefixes = qry.pkg_names_get_packages_prefixes( app.config["CACHE_DIR"]) credits_file = os.path.join(app.config["LOCAL_DIR"], "credits.html") credits = local_info.read_html(credits_file) return dict(packages_prefixes=packages_prefixes, searchform=SearchForm(), last_update=last_update, credits=credits)
def skeleton_variables(): update_ts_file = os.path.join(app.config['CACHE_DIR'], 'last-update') # TODO, this part should be moved to per blueprint context processor last_update = local_info.read_update_ts(update_ts_file) packages_prefixes = qry.pkg_names_get_packages_prefixes( app.config["CACHE_DIR"]) credits_file = os.path.join(app.config["LOCAL_DIR"], "credits.html") credits = local_info.read_html(credits_file) return dict(packages_prefixes=packages_prefixes, searchform=SearchForm(), last_update=last_update, credits=credits, name=app.import_name)