Initial cleanup of the codebase
Change-Id: Idbc92ea3c2d7ee4d4807d1d83ceee9a299b9a9f7
diff --git a/service/config.py b/service/config.py
new file mode 100644
index 0000000..36e8c91
--- /dev/null
+++ b/service/config.py
@@ -0,0 +1,64 @@
+__author__ = 'hanl'
+
+DEBUG = True
+
+QUERY_LANGUAGES = {"poliqarp": "Poliqarp", "cosmas2": "Cosmas 2", "annis": "ANNIS",
+ "cql": "CQL"}
+
+WTF_CSRF_ENABLED = True
+SECRET_KEY = "nHim5JB-YqkX7sS55jayGBnga8WmqgpkzieGe8UhojE"
+REMEMBER_COOKIE_NAME = "rememberMe"
+
+# RECAPTCHA_PUBLIC_KEY = "YOUR PUBLIC KEY" # https://www.google.com/recaptcha
+# RECAPTCHA_PRIVATE_KEY = "YOUR PRIVATE KEY" # https://www.google.com/recaptcha
+
+# Oauth client data
+OAUTH2_CLIENT_ID = "fCBbQkA3ZDBhMzc2Nw=="
+OAUTH2_CLIENT_SECRET = "f58c361f7e8e07a05133322f6af6727440edcab7dbc02a49508c0168bd18c7ed"
+OPENID_CONNECT_SCOPES = "openid profile"
+API_SERVER = "http://localhost:7070/api/v0.1"
+
+# suggest authentication based on the available schema
+AUTH_PROVIDER = "providers.CustomProvider"
+
+BABEL_DEFAULT_LOCALE = 'de'
+
+LANGUAGES = {
+ 'en': 'English',
+ 'de': 'Deutsch'
+}
+
+ADMINS = {'OAuth2Provider': ('access_token', ['auth_token']),
+ 'CustomProvider': ('username', ['MichaelHanl', 'korap'])}
+
+
+# email settings
+# MAIL_SERVER : default 'localhost'
+#MAIL_PORT : default 25
+#MAIL_USE_TLS : default False
+#MAIL_USE_SSL : default False
+#MAIL_USERNAME : default None
+#MAIL_PASSWORD : default None
+DEFAULT_MAIL_SENDER = "korap@ids-mannheim.de"
+
+
+class URIBuilder(object):
+ def __init__(self, url=API_SERVER):
+ self.base = url
+ self.path = []
+
+ def addPath(self, path=None):
+ if path:
+ self.path.append(path)
+ return self
+
+ def build(self):
+ end = self.base
+ if not end:
+ raise ValueError("no base URL set!")
+ for p in self.path:
+ if end.endswith("/"):
+ end += p
+ else:
+ end += "/" + p
+ return end
\ No newline at end of file