Akron | ca9bd98 | 2016-12-06 16:59:57 +0100 | [diff] [blame] | 1 | __author__ = 'hanl' |
| 2 | |
| 3 | DEBUG = True |
| 4 | |
| 5 | QUERY_LANGUAGES = {"poliqarp": "Poliqarp", "cosmas2": "Cosmas 2", "annis": "ANNIS", |
| 6 | "cql": "CQL"} |
| 7 | |
| 8 | WTF_CSRF_ENABLED = True |
| 9 | SECRET_KEY = "nHim5JB-YqkX7sS55jayGBnga8WmqgpkzieGe8UhojE" |
| 10 | REMEMBER_COOKIE_NAME = "rememberMe" |
| 11 | |
| 12 | # RECAPTCHA_PUBLIC_KEY = "YOUR PUBLIC KEY" # https://www.google.com/recaptcha |
| 13 | # RECAPTCHA_PRIVATE_KEY = "YOUR PRIVATE KEY" # https://www.google.com/recaptcha |
| 14 | |
| 15 | # Oauth client data |
| 16 | OAUTH2_CLIENT_ID = "fCBbQkA3ZDBhMzc2Nw==" |
| 17 | OAUTH2_CLIENT_SECRET = "f58c361f7e8e07a05133322f6af6727440edcab7dbc02a49508c0168bd18c7ed" |
| 18 | OPENID_CONNECT_SCOPES = "openid profile" |
| 19 | API_SERVER = "http://10.0.10.13:7070/api/v0.1" |
| 20 | |
| 21 | # suggest authentication based on the available schema |
| 22 | AUTH_PROVIDER = "providers.CustomProvider" |
| 23 | BABEL_DEFAULT_LOCALE = 'de' |
| 24 | |
| 25 | LANGUAGES = { |
| 26 | 'en': 'English', |
| 27 | 'de': 'Deutsch' |
| 28 | } |
| 29 | |
| 30 | |
| 31 | class URIBuilder(object): |
| 32 | def __init__(self, url=API_SERVER): |
| 33 | self.base = url |
| 34 | self.path = [] |
| 35 | |
| 36 | def addPath(self, path=None): |
| 37 | if path: |
| 38 | self.path.append(path) |
| 39 | return self |
| 40 | |
| 41 | def build(self): |
| 42 | end = self.base |
| 43 | for p in self.path: |
| 44 | if end.endswith("/"): |
| 45 | end += p |
| 46 | else: |
| 47 | end += "/" + p |
| 48 | return end |