コード例 #1
0
ファイル: treeline.py プロジェクト: BackupTheBerlios/treeline
def main():
    userStyle = '-style' in ' '.join(sys.argv)
    app = QtGui.QApplication(sys.argv)
    setModulePath()
    setupTranslator(app)  # must be before importing any treeline modules
    setLocalEncoding()

    import treedoc
    from cmdline import CmdLine
    import treecontrol
    import treemainwin

    if not treedoc.testXmlParser():
        QtGui.QMessageBox.critical(None, _('Error'),
                                   _('Error loading XML Parser\n'\
                                     'See TreeLine ReadMe file'), 1, 0)
        sys.exit(3)
    try:
        opts, args = getopt.gnu_getopt(sys.argv, CmdLine.options,
                                       CmdLine.longOptions)
    except getopt.GetoptError:
        import cmdline
        cmdline.printUsage()
        sys.exit(2)
    args = args[1:]

    treeControl = treecontrol.TreeControl(userStyle)

    if opts:
        CmdLine(opts, args)
    else:
        treeControl.firstWindow(args)
        signal.signal(signal.SIGINT, signal.SIG_IGN)
        app.exec_()
コード例 #2
0
ファイル: treeline.py プロジェクト: rodolfoap/treeline141
def main():
    userStyle = '-style' in ' '.join(sys.argv)
    app = QtGui.QApplication(sys.argv)
    setModulePath()
    setupTranslator(app)  # must be before importing any treeline modules
    setLocalEncoding()

    import treedoc
    from cmdline import CmdLine
    import treecontrol
    import treemainwin

    if not treedoc.testXmlParser():
        QtGui.QMessageBox.critical(None, _('Error'),
                                   _('Error loading XML Parser\n'\
                                     'See TreeLine ReadMe file'), 1, 0)
        sys.exit(3)
    try:
        opts, args = getopt.gnu_getopt(sys.argv, CmdLine.options,
                                       CmdLine.longOptions)
    except getopt.GetoptError:
        import cmdline
        cmdline.printUsage()
        sys.exit(2)
    args = args[1:]

    treeControl = treecontrol.TreeControl(userStyle)

    if opts:
        CmdLine(opts, args)
    else:
        treeControl.firstWindow(args)
        signal.signal(signal.SIGINT, signal.SIG_IGN)
        app.exec_()
コード例 #3
0
def main():
    try:
        userStyle = '-style' in ' '.join(sys.argv)
        app = QtGui.QApplication(sys.argv)
        setModulePath()
        setupTranslator(app)  # must be before importing any treeline modules
        setLocalEncoding()

        print "Starting module treedoc"
        import treedoc
        print "Starting module CmdLine"
        from cmdline import CmdLine
        print "Starting module treecontrol"
        import treecontrol
        print "Starting module treemainwin"
        import treemainwin

        if not treedoc.testXmlParser():
            QtGui.QMessageBox.critical(None, _('Error'),
                                       _('Error loading XML Parser\n'\
                                         'See TreeLine ReadMe file'), 1, 0)
            sys.exit(3)
        try:
            opts, args = getopt.gnu_getopt(sys.argv, CmdLine.options,
                                           CmdLine.longOptions)
        except getopt.GetoptError:
            import cmdline
            cmdline.printUsage()
            sys.exit(2)
        args = args[1:]

        treeControl = treecontrol.TreeControl(userStyle)

        if opts:
            CmdLine(opts, args)
        else:
            treeControl.firstWindow(args)
            signal.signal(signal.SIGINT, signal.SIG_IGN)
            app.exec_()
    except NameError:
        if ModuleInfo.LoadedQtDerivated == False:
            print "Qt Derivated module was not loaded correctly."
        else:
            print "PyQt4 and PySide can't be loaded in same time."