From 1177c0aed5c13ee62e014b58cbdc7a9577d676ba Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 12 Oct 2013 22:36:52 +0300 Subject: [PATCH] default settings improvements --- .gitignore | 4 +++- conf/.gitkeep | 1 - motioneye.py | 13 +++++++++++++ settings_default.py | 4 ++-- 4 files changed, 18 insertions(+), 4 deletions(-) delete mode 100644 conf/.gitkeep diff --git a/.gitignore b/.gitignore index 839a8ab..d8d4597 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ *.conf *.json .settings -settings.py \ No newline at end of file +settings.py +conf +run diff --git a/conf/.gitkeep b/conf/.gitkeep deleted file mode 100644 index 0538fcf..0000000 --- a/conf/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -this directory contains config files for motionEye as well as for motion \ No newline at end of file diff --git a/motioneye.py b/motioneye.py index e6a962c..61cef10 100755 --- a/motioneye.py +++ b/motioneye.py @@ -95,6 +95,18 @@ def _configure_settings(): print('unknown command line option: ' + arg) _print_help() sys.exit(-1) + + try: + os.makedirs(settings.CONF_PATH) + + except: + pass + + try: + os.makedirs(settings.RUN_PATH) + + except: + pass def _print_help(): @@ -161,6 +173,7 @@ if __name__ == '__main__': _configure_settings() _configure_signals() _configure_logging() + _start_motion() _start_cleanup() _start_server() diff --git a/settings_default.py b/settings_default.py index d5c8058..a7846da 100644 --- a/settings_default.py +++ b/settings_default.py @@ -6,10 +6,10 @@ import sys PROJECT_PATH = os.path.dirname(sys.argv[0]) CONF_PATH = os.path.join(PROJECT_PATH, 'conf') -RUN_PATH = PROJECT_PATH +RUN_PATH = os.path.join(PROJECT_PATH, 'run') -DEBUG = True LOG_LEVEL = logging.DEBUG +DEBUG = (LOG_LEVEL == logging.DEBUG) TEMPLATE_PATH = os.path.join(PROJECT_PATH, 'templates') -- 2.39.5