Replace raw_input with six.moves.input
[mediagoblin.git] / lazystarter.sh
index 2842d5d57a9656876e9e3202c37e1e762a3a0bc4..0ed22fd8a00b9d3c88bf09731ee36a0ad48dd950 100755 (executable)
 
 selfname=$(basename "$0")
 local_bin="./bin"
+
 case "$selfname" in
     lazyserver.sh)
-        starter_cmd=gunicorn
+        starter_cmd=paster;
         ini_prefix=paste
         ;;
     lazycelery.sh)
@@ -36,8 +37,9 @@ esac
 if [ "$1" = "-h" ]; then
     echo "$0 [-h] [-c filename.ini] [ARGS_to_${starter_cmd} ...]"
     echo ""
-    echo "   For Gunicorn settings, see at:"
-    echo "      http://docs.gunicorn.org/en/19.0/settings.html"
+    echo "   For example:"
+    echo "         $0 -c fcgi.ini port_number=23371"
+    echo "     or: $0 --server-name=fcgi --log-file=paste.log"
     echo ""
     echo "   The configfile defaults to ${ini_prefix}_local.ini,"
     echo "   if that is readable, otherwise ${ini_prefix}.ini."
@@ -66,16 +68,26 @@ else
     exit 1
 fi
 
+# If the user somehow doesn't have a mediagoblin.ini
+# (maybe they aren't using make) give them one
+#   ... this doesn't fulfill all conditions maybe, but is a stopgap
+#   that doesn't have noticable race conditions
+if [ -f mediagoblin.example.ini ] && \
+    [ ! -f mediagoblin.ini ]; then
+    echo "No mediagoblin.ini found, making one";
+    cp --no-clobber mediagoblin.example.ini mediagoblin.ini;
+fi
+
 set -x
 export CELERY_ALWAYS_EAGER=true
 case "$selfname" in
     lazyserver.sh)
-        $starter --paste "$ini_file" "$@"
+        $starter serve "$ini_file" "$@" --reload;
         ;;
     lazycelery.sh)
         MEDIAGOBLIN_CONFIG="${ini_file}" \
             CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_celery \
-            $starter "$@"
+            $starter -B "$@"
         ;;
     *) exit 1 ;;
 esac