def check_context(): webcontexts = athana.contexts if (not filter(lambda x: x.name == '/md_upload', webcontexts)) and athana.GLOBAL_ROOT_DIR != "no-root-dir-set": print 'going to add context md_upload' webcontext = athana.addContext("/md_upload", ".") webcontext_file = webcontext.addFile("metadata/upload.py") webcontext_file.addHandler("handle_request").addPattern("/.*")
def register_blueprint(self, blueprint): self.blueprints[blueprint.name] = blueprint logg.info("added blueprint %s, import name %s", blueprint.name, blueprint.import_name) blueprint_reldir = path.relpath(blueprint.root_path, start=athana_http.getBase()) context_name = blueprint.name if blueprint.name.startswith("/") else "/" + blueprint.name ctx = athana_http.addContext(context_name, blueprint_reldir) logg.info("added athana context from blueprint with context_name %s, dir %s", context_name, blueprint_reldir) blueprint.athana_context = ctx