default settings improvements
authorCalin Crisan <ccrisan@gmail.com>
Sat, 12 Oct 2013 19:36:52 +0000 (22:36 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 12 Oct 2013 19:37:21 +0000 (22:37 +0300)
.gitignore
conf/.gitkeep [deleted file]
motioneye.py
settings_default.py

index 839a8ab3f5b37b1467c9abd88d338beb5672e02d..d8d45974e259e0aacd4cf694df81aa918f7b907b 100644 (file)
@@ -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 (file)
index 0538fcf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-this directory contains config files for motionEye as well as for motion
\ No newline at end of file
index e6a962c9a55f853207024bcc2587ad9e71807840..61cef105c1a2e721eac40f04f573bfcea41a7b9e 100755 (executable)
@@ -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()
index d5c8058f0c54bc7b1778e29b6d250b570a9f94fa..a7846dae79cdf658cddd99ca85f435cffbbc8fef 100644 (file)
@@ -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')