From 72941558d2fa0950d782d0cd2c0bfe2d5797a93f Mon Sep 17 00:00:00 2001 From: krateng Date: Tue, 21 Dec 2021 22:13:27 +0100 Subject: [PATCH] Small adjustments --- DEVELOPMENT.md | 2 ++ maloja/__main__.py | 2 ++ maloja/proccontrol/__main__.py | 2 -- maloja/proccontrol/control.py | 6 +++++- 4 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 maloja/proccontrol/__main__.py diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index d00e038..2cb62c6 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -11,6 +11,8 @@ Python dependencies can be installed with `pip install -r requirements.txt` ## Running the server +For development, you might not want to install maloja files all over your filesystem. Use the environment variable `MALOJA_DATA_DIRECTORY` to force all user files into one central directory - this way, you can also quickly change between multiple configurations. + You can quickly run the server with all your local changes with `python3 -m maloja run`. You can also build the package with `pip install .`. diff --git a/maloja/__main__.py b/maloja/__main__.py index e948dcb..4fcd284 100644 --- a/maloja/__main__.py +++ b/maloja/__main__.py @@ -1,2 +1,4 @@ +# make the package itself runnable with python -m maloja + from .proccontrol.control import main main() diff --git a/maloja/proccontrol/__main__.py b/maloja/proccontrol/__main__.py deleted file mode 100644 index 7c2115d..0000000 --- a/maloja/proccontrol/__main__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .control import main -main() diff --git a/maloja/proccontrol/control.py b/maloja/proccontrol/control.py index 3043bae..ea68a5e 100644 --- a/maloja/proccontrol/control.py +++ b/maloja/proccontrol/control.py @@ -81,6 +81,10 @@ def direct(): setup() from .. import server +def debug(): + os.environ["MALOJA_DEV_MODE"] = 'true' + direct() + @mainfunction({"l":"level"},shield=True) def main(action,*args,**kwargs): @@ -89,7 +93,7 @@ def main(action,*args,**kwargs): "restart":restart, "stop":stop, "run":direct, - "debug":direct, + "debug":debug, "import":tasks.loadlastfm, "backup":tasks.backuphere,