5 from optparse import OptionParser
6 from PyQt4.QtGui import *
9 exe = os.path.abspath(sys.argv[0])
12 print "Using %s = %s" % (e, os.environ[e])
14 def print_env(config):
15 if not config.verbose:
18 if sys.platform == "darwin":
19 using_env("DYLD_FRAMEWORK_PATH")
20 using_env("DYLD_LIBRARY_PATH")
23 print "Using sys.path =", sys.path
25 if sys.platform == "darwin":
26 # for testing on mac os x 10.5 - baris
27 sys.path.append("/opt/local/lib/python2.5/site-packages/")
29 DIR = os.path.dirname(exe)
30 CONTENTS = os.path.dirname(DIR)
31 RESOURCES = os.path.join(CONTENTS, "Resources")
32 FRAMEWORKS = os.path.join(CONTENTS, "Frameworks")
34 DYLD_FRAMEWORK_PATH = FRAMEWORKS
35 DYLD_LIBRARY_PATH = RESOURCES
36 PATH = os.getenv("PATH")
37 SFI_PATH = os.path.join(RESOURCES, "sfa/client")
38 PATH=":".join([RESOURCES, SFI_PATH, PATH])
40 os.environ["PATH"] = PATH
41 os.environ["DYLD_LIBRARY_PATH"] = DYLD_LIBRARY_PATH
42 os.environ["DYLD_FRAMEWORK_PATH"] = DYLD_FRAMEWORK_PATH
43 if os.path.exists(RESOURCES): sys.path.append(RESOURCES)
44 if os.path.exists(FRAMEWORKS): sys.path.append(FRAMEWORKS)
46 elif sys.platform == "linux2":
47 sys.path.extend(["/usr/share", "/usr/share/sface"])
50 from sface.mainwindow import MainWindow
51 from sface.config import config
54 app = QApplication(args)
58 background-color:rgba(255,255,255,120);
62 QTreeView, QLineEdit {
63 border: 2px solid gray;
70 background-color: white;
71 border: 2px solid gray;
77 background-color: #5599FF;
88 win.redirectOutputToLog()
89 win.setWindowTitle("Sface: SFA Interface")
93 app.setActiveWindow(win)
98 if __name__ == "__main__":
100 config.add_options_to_OptionParser(parser)
101 (options,args)=parser.parse_args()
102 config.update_from_OptionParser(options)
103 config.display("After command-line")