From 0db2d29f4e327f632bd3764e020d0d05a82bceb1 Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Wed, 23 Sep 2020 16:57:17 +0200 Subject: [PATCH] initial commit --- .gitignore | 2 ++ Pipfile | 20 ++++++++++++++++++++ settings-example.json | 10 ++++++++++ src/StorageLeaf.py | 25 +++++++++++++++++++++++++ src/__init__.py | 0 src/blueprints/Routes.py | 11 +++++++++++ src/blueprints/__init__.py | 0 src/logic/Constants.py | 4 ++++ src/logic/__init__.py | 0 src/version.json | 7 +++++++ 10 files changed, 79 insertions(+) create mode 100644 .gitignore create mode 100644 Pipfile create mode 100644 settings-example.json create mode 100644 src/StorageLeaf.py create mode 100644 src/__init__.py create mode 100644 src/blueprints/Routes.py create mode 100644 src/blueprints/__init__.py create mode 100644 src/logic/Constants.py create mode 100644 src/logic/__init__.py create mode 100644 src/version.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2a71b46 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/Pipfile.lock +/settings.json diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..57670da --- /dev/null +++ b/Pipfile @@ -0,0 +1,20 @@ +[[source]] +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + +[[source]] +url = "https://pypi.thecodelabs.de" +verify_ssl = true +name = "TheCodeLabs" + +[requires] +python_version = "3" + +[packages] +flask = "==1.1.2" +gevent = "==20.6.1" +TheCodeLabs-BaseUtils = "*" +TheCodeLabs-FlaskUtils = "*" + +[dev-packages] diff --git a/settings-example.json b/settings-example.json new file mode 100644 index 0000000..5324240 --- /dev/null +++ b/settings-example.json @@ -0,0 +1,10 @@ +{ + "server": { + "listen": "0.0.0.0", + "port": 10003, + "secret": "", + "useSSL": false, + "keyfile": "", + "certfile": "" + } +} \ No newline at end of file diff --git a/src/StorageLeaf.py b/src/StorageLeaf.py new file mode 100644 index 0000000..e3a6fa6 --- /dev/null +++ b/src/StorageLeaf.py @@ -0,0 +1,25 @@ +import os + +from TheCodeLabs_BaseUtils.DefaultLogger import DefaultLogger +from TheCodeLabs_FlaskUtils.FlaskBaseApp import FlaskBaseApp + +from blueprints import Routes +from logic import Constants +from logic.Page import PageManager +from logic.services.JenkinsSingleJobService import JenkinsSingleJobService + +LOGGER = DefaultLogger().create_logger_if_not_exists(Constants.APP_NAME) + + +class StorageLeaf(FlaskBaseApp): + def __init__(self, appName: str): + super().__init__(appName, os.path.dirname(__file__), LOGGER, serveRobotsTxt=False) + + def _register_blueprints(self, app): + app.register_blueprint(Routes.construct_blueprint(self._settings)) + return app + + +if __name__ == '__main__': + website = StorageLeaf(Constants.APP_NAME) + website.start_server() diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/blueprints/Routes.py b/src/blueprints/Routes.py new file mode 100644 index 0000000..7101395 --- /dev/null +++ b/src/blueprints/Routes.py @@ -0,0 +1,11 @@ +from flask import Blueprint, render_template + + +def construct_blueprint(settings): + routes = Blueprint('routes', __name__) + + @routes.route('/', methods=['GET']) + def index(): + return render_template('index.html') + + return routes diff --git a/src/blueprints/__init__.py b/src/blueprints/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/logic/Constants.py b/src/logic/Constants.py new file mode 100644 index 0000000..f709408 --- /dev/null +++ b/src/logic/Constants.py @@ -0,0 +1,4 @@ +import os + +APP_NAME = 'StorageLeaf' +ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) diff --git a/src/logic/__init__.py b/src/logic/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/version.json b/src/version.json new file mode 100644 index 0000000..f02f8c0 --- /dev/null +++ b/src/version.json @@ -0,0 +1,7 @@ +{ + "version": { + "name": "v1.0.0", + "code": 1, + "date": "23.09.20" + } +} \ No newline at end of file -- GitLab