Example #1
0
def main():

    """Main program."""

    description = str(i18n("Simple log file viewer"))
    version = "0.3"
    about = KAboutData("lovi", "lovi", version, description,
        KAboutData.License_GPL, "Copyright (C) 2005-2006 by Akos Polster")
    about.addAuthor("Akos Polster", "", "*****@*****.**")
    KCmdLineArgs.init(sys.argv, about)
    KCmdLineArgs.addCmdLineOptions([("+files", "Files to monitor")])
    app = KApplication()
    mainWindow = MainWin(None, "lovi#")
    app.setMainWidget(mainWindow)
    
    # Get list of monitored files from the command line or from the cfg file
    args = KCmdLineArgs.parsedArgs()
    if args.count() > 0:
        for i in range(0, args.count()):
            mainWindow.monitor(args.arg(i))
    else:
        cfg = app.config()
        cfg.setGroup("Monitor")
        files = cfg.readListEntry("files")
        for f in files:
            mainWindow.monitor(str(f))
        
    mainWindow.show()
    app.exec_loop()
def main():
    aboutData = KAboutData(
        PACKAGE, PROGRAMNAME, VERSION,
        I18N_NOOP("LilyKDE servicemenu helper"),
        KAboutData.License_GPL,
        "Copyright (c) 2008, " + AUTHOR,
        "", HOMEPAGE)
    KCmdLineArgs.init (sys.argv, aboutData)
    KCmdLineArgs.addCmdLineOptions([
        ("+files", I18N_NOOP("LilyPond files to convert"))
        ])
    app = KApplication()
    log = LogWidget()
    app.setMainWidget(log)
    log.setMinimumHeight(240)
    log.setMinimumWidth(400)
    log.setCaption(PROGRAMNAME)
    log.show()

    # get the files to convert
    pa = KCmdLineArgs.parsedArgs()
    files = map(pa.arg, range(pa.count()))

    # start the first job. Itself takes care of running the rest.
    Job(files, log)
    app.exec_loop()
Example #3
0
 def prepareCommandLine():
     args = KCmdLineArgs.parsedArgs()
     return args.isSet("statusbar") or args.isSet("s")