Exemple #1
0
    from optparse import OptionParser

    usage = ctx.Pds.i18n("%prog packages_to_install")
    parser = OptionParser(usage=usage)
    args = filter(lambda x: not x.startswith('-'), sys.argv[1:])
    if len(sys.argv) > 1:

        from mainwindow import MainWindow
        if ctx.Pds.session == ctx.pds.Kde4:
            KCmdLineArgs.init([], aboutData)
            app = KApplication()
        else:
            app = QtGui.QApplication(sys.argv)
            font = ctx.Pds.settings('font','Dejavu Sans,10').split(',')
            app.setFont(QtGui.QFont(font[0], int(font[1])))

        setSystemLocale()
        manager = MainWindow(app, silence = True)

        manager.centralWidget().state._selected_packages = args
        manager.centralWidget().state.operationAction(args, silence = True)
        manager.centralWidget().progressDialog.show()

        sys.excepthook = handleException
        ctx._time()
        app.exec_()
    else:
        parser.print_usage()