changeset 226:d8bb72f00eec

distutils install: fixed plugin import and log file path
author Goffi <goffi@goffi.org>
date Wed, 05 Jan 2011 02:39:35 +0100
parents fd9b7834d98a
children 533507bb4e32
files frontends/src/__init__.py src/sat.sh src/sat.tac
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/sat.sh	Wed Jan 05 01:56:36 2011 +0100
+++ b/src/sat.sh	Wed Jan 05 02:39:35 2011 +0100
@@ -3,6 +3,7 @@
 NAME='sat'
 
 PID_FILE="/tmp/$NAME.pid"
+LOG_FILE=~/".$NAME/$NAME.log"
 DAEMON="n"
 MAIN_OPTIONS="-${DAEMON}oy"
 TAP_PATH="./"
@@ -10,7 +11,11 @@
 
 #Don't change the next line
 AUTO_OPTIONS=""
-ADDITIONAL_OPTIONS="--pidfile $PID_FILE $AUTO_OPTIONS"
+ADDITIONAL_OPTIONS="--pidfile $PID_FILE --logfile $LOG_FILE $AUTO_OPTIONS"
 
-echo "autogenere == >" twistd $MAIN_OPTIONS $TAP_PATH$TAP_FILE $ADDITIONAL_OPTIONS 
+log_dir=`dirname "$LOG_FILE"`
+if [ ! -d $log_dir ] ; then
+	mkdir $log_dir
+fi
+
 twistd $MAIN_OPTIONS $TAP_PATH$TAP_FILE $ADDITIONAL_OPTIONS 
--- a/src/sat.tac	Wed Jan 05 01:56:36 2011 +0100
+++ b/src/sat.tac	Wed Jan 05 02:39:35 2011 +0100
@@ -369,7 +369,9 @@
     def _import_plugins(self):
         """Import all plugins found in plugins directory"""
         #TODO: manage dependencies
-        plug_lst = [os.path.splitext(plugin)[0] for plugin in map(os.path.basename,glob ("plugins/plugin*.py"))]
+        import sat.plugins
+        plugins_path = os.path.dirname(sat.plugins.__file__) 
+        plug_lst = [os.path.splitext(plugin)[0] for plugin in map(os.path.basename,glob (os.path.join(plugins_path,"plugin*.py")))]
 
         for plug in plug_lst:
             plug_path = 'sat.plugins.'+plug