-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
100 lines (77 loc) · 2.91 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import os
import textwrap
from logging import DEBUG
# Logging related configuration:
LOG_LEVEL = DEBUG
LOGGING_CONFIG = "%(asctime)-15s %(name)s %(levelname)s - %(message)s"
# Flask config:
FLASK_HOST = os.getenv("FLASK_HOST")
# The filesystem directory where the metadata editor is running from:
PWD = os.path.dirname(os.path.realpath(__file__))
# The github organisation/username to use when communicating with github (e.g. 'OBOFoundry')
GITHUB_ORG = "OBOFoundry"
# The github repository to use for editing PURL configuration (e.g. 'purl.obolibrary.org')
GITHUB_PURL_REPO = "purl.obolibrary.org"
# The directory in which the PURL config files are stored within the PURL repo
GITHUB_PURL_DIR = "config"
# The github repository to use for editing Foundry registry (e.g. 'OBOFoundry.github.io')
GITHUB_FOUNDRY_REPO = "OBOFoundry.github.io"
# The directory in which the Registry config files within the Foundry repo
GITHUB_FOUNDRY_DIR = "ontology"
# File extension for YAML files
YAML_EXT = ".yml"
# File extension for Markdown files
MARKDOWN_EXT = ".md"
# The location to post New Ontology Registration issues to:
REGISTRY_REQUEST = (
f"repos/{GITHUB_ORG}/{GITHUB_FOUNDRY_REPO}/issues"
)
# The location of the PURL validation schema:
PURL_SCHEMA = (
f"https://github.com/{GITHUB_ORG}/{GITHUB_PURL_REPO}/raw/"
f"master/tools/config.schema.json"
)
# The location of the REGISTRY validations schema
REGISTRY_SCHEMA = (
f"https://github.com/{GITHUB_ORG}/{GITHUB_FOUNDRY_REPO}/raw/master/util/"
f"schema/registry_schema.json"
)
# The URL where information (e.g. long names) about ontologies can be retrieved.
ONTOLOGY_METADATA_URL = (
f"https://github.com/{GITHUB_ORG}/{GITHUB_FOUNDRY_REPO}/raw/"
f"master/registry/ontologies.yml"
)
# Used to help prevent CSRF attacks:
FLASK_SECRET_KEY = os.getenv("FLASK_SECRET_KEY")
# Location of the database file:
DATABASE_URI = "sqlite:////tmp/github-flask.db"
# GitHub OAuth parameters used to access the GitHub API
GITHUB_APP_STATE = os.getenv("GITHUB_APP_STATE")
GITHUB_CLIENT_ID = os.getenv("GITHUB_CLIENT_ID")
GITHUB_CLIENT_SECRET = os.getenv("GITHUB_CLIENT_SECRET")
# Template used to generate the initial text when launching the editor with a new PURL configuration
# file:
NEW_PROJECT_PURL_TEMPLATE = textwrap.dedent(
"""
# PURL configuration for http://purl.obolibrary.org/obo/{idspace_lower}
idspace: {idspace_upper}
base_url: /obo/{idspace_lower}
products:
- {idspace_lower}.owl: https://raw.githubusercontent.com/{org}/{git}/master/{idspace_lower}.owl
term_browser: ontobee
"""
)
NEW_PROJECT_REGISTRY_TEMPLATE = """---
{yaml_registry_details}
---
{description}
"""
NEW_ONTOLOGY_EMAIL_TEMPLATE = """Dear OBO Foundry,
We would like to request the namespace '{idSpace}' in the OBO Library.
Request prefix: {idSpace}
Ontology title: {ontologyTitle}
Ontology location: {ontoLoc}
Domain: {domain}
The link to the issue is: {issueLink}
Kind regards,
{contactPerson}"""