From 188ac78b1f6f1ba47ae799e70a47c96261b48cf0 Mon Sep 17 00:00:00 2001 From: Elia el Lazkani Date: Wed, 25 Dec 2024 21:27:55 +0100 Subject: [PATCH] chore(): Cleans up the docs a bit --- TODO | 10 ---------- Makefile => docs/Makefile | 2 +- docs/data.rst | 5 ----- docs/db.rst | 5 ----- docs/exceptions.rst | 5 ----- docs/index.rst | 5 +---- make.bat => docs/make.bat | 0 docs/shortener.rst | 2 +- shortenit/main.py | 6 +++++- 9 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 TODO rename Makefile => docs/Makefile (96%) delete mode 100644 docs/data.rst delete mode 100644 docs/db.rst delete mode 100644 docs/exceptions.rst rename make.bat => docs/make.bat (100%) diff --git a/TODO b/TODO deleted file mode 100644 index 8985c7f..0000000 --- a/TODO +++ /dev/null @@ -1,10 +0,0 @@ -This list is incomplete, these are a few of the things that need to be done. - -TODO: -* Documentation/Code comments -* Proper type-setting across the board -* PEP8 -* Refactor code -* Dockerize -* favicon.ico is being injected into the database (need fix) -* Fix YAML warning on startup. diff --git a/Makefile b/docs/Makefile similarity index 96% rename from Makefile rename to docs/Makefile index b97de95..a9d2648 100644 --- a/Makefile +++ b/docs/Makefile @@ -5,7 +5,7 @@ # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build -SOURCEDIR = docs +SOURCEDIR = BUILDDIR = build # Put it first so that "make" without argument is like "make help". diff --git a/docs/data.rst b/docs/data.rst deleted file mode 100644 index 86295d9..0000000 --- a/docs/data.rst +++ /dev/null @@ -1,5 +0,0 @@ -Data -==== - -.. automodule:: shortenit.data - :members: diff --git a/docs/db.rst b/docs/db.rst deleted file mode 100644 index cb716d6..0000000 --- a/docs/db.rst +++ /dev/null @@ -1,5 +0,0 @@ -DB -=== - -.. automodule:: shortenit.db - :members: diff --git a/docs/exceptions.rst b/docs/exceptions.rst deleted file mode 100644 index 4bdddb9..0000000 --- a/docs/exceptions.rst +++ /dev/null @@ -1,5 +0,0 @@ -Exceptions -========== - -.. automodule:: shortenit.exceptions - :members: diff --git a/docs/index.rst b/docs/index.rst index bb10dfb..cba0de7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,14 +12,11 @@ Shortenit Documentation .. toctree:: - :maxdepth: 1 + :maxdepth: 2 :caption: Contents: common config - data - db - exceptions logger main pointer diff --git a/make.bat b/docs/make.bat similarity index 100% rename from make.bat rename to docs/make.bat diff --git a/docs/shortener.rst b/docs/shortener.rst index 000534e..40782ee 100644 --- a/docs/shortener.rst +++ b/docs/shortener.rst @@ -1,5 +1,5 @@ Shortener ========= -.. automodule:: shortenit.shortener +.. automodule:: shortenit.models.shortener :members: diff --git a/shortenit/main.py b/shortenit/main.py index 7b8bc2b..21cf923 100644 --- a/shortenit/main.py +++ b/shortenit/main.py @@ -31,7 +31,10 @@ def main() -> typing.NoReturn: debug = True if args.verbose > 0 else False verbosity_level = verbosity(args.verbose) setup_logging(args.logger, verbosity_level) - config = Config(CONFIGURATION).get_config() + if args.config: + config = Config(args.config).get_config() + else: + config = Config(CONFIGURATION).get_config() db_config = config.get("Database", None) server_config = config.get("Server", None) if db_config: @@ -96,6 +99,7 @@ def argument_parse() -> argparse.ArgumentParser: parser.add_argument( "-l", "--logger", type=str, help="The logger YAML configuration file." ) + parser.add_argument("-c", "--config", type=str, help="The shortenit configuration file.") return parser