on the way of getting rid of HTML in XML viz. The model passes a QObject instead...
[sface.git] / sface-run
index 84afd0c..eecabd2 100755 (executable)
--- a/sface-run
+++ b/sface-run
@@ -11,8 +11,8 @@ exe = os.path.abspath(sys.argv[0])
 def using_env(e):
     print "Using %s = %s" % (e, os.environ[e])
 
-def print_env(options):
-    if not options.verbose:
+def print_env(config):
+    if not config.verbose:
         return
 
     if sys.platform == "darwin":
@@ -30,9 +30,7 @@ if sys.platform == "darwin":
     CONTENTS = os.path.dirname(DIR)
     RESOURCES = os.path.join(CONTENTS, "Resources")
     FRAMEWORKS = os.path.join(CONTENTS, "Frameworks")
-    
-    sys.path.extend([RESOURCES, FRAMEWORKS])
-    
+     
     DYLD_FRAMEWORK_PATH = FRAMEWORKS
     DYLD_LIBRARY_PATH = RESOURCES
     PATH = os.getenv("PATH")
@@ -42,6 +40,8 @@ if sys.platform == "darwin":
     os.environ["PATH"] = PATH
     os.environ["DYLD_LIBRARY_PATH"] = DYLD_LIBRARY_PATH
     os.environ["DYLD_FRAMEWORK_PATH"] = DYLD_FRAMEWORK_PATH
+    if os.path.exists(RESOURCES):  sys.path.append(RESOURCES)
+    if os.path.exists(FRAMEWORKS): sys.path.append(FRAMEWORKS)
 
 elif sys.platform == "linux2":
     sys.path.extend(["/usr/share", "/usr/share/sface"])
@@ -101,5 +101,5 @@ if __name__ == "__main__":
     (options,args)=parser.parse_args()
     config.update_from_OptionParser(options)
     config.display("After command-line")
-    print_env(options)
+    print_env(config)
     main(sys.argv)