当前位置: 首页>>代码示例>>Python>>正文


Python KApplication.exec_loop方法代码示例

本文整理汇总了Python中kdecore.KApplication.exec_loop方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.exec_loop方法的具体用法?Python KApplication.exec_loop怎么用?Python KApplication.exec_loop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kdecore.KApplication的用法示例。


在下文中一共展示了KApplication.exec_loop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import exec_loop [as 别名]
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", "", "[email protected]")
    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()
开发者ID:BackupTheBerlios,项目名称:lovi-svn,代码行数:31,代码来源:main.py

示例2: main

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import exec_loop [as 别名]
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()
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:28,代码来源:lilypond-servicemenu-helper.py

示例3: languageChange

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import exec_loop [as 别名]
        self.tabTorrent.setCurrentPage(-1)

        KPyBTTorrentBaseLayout.addWidget(self.tabTorrent,0,0)

        self.languageChange()

        self.resize(QSize(431,270).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)


    def languageChange(self):
        self.setCaption(self.__tr("Form1"))


    def __tr(self,s,c = None):
        return qApp.translate("KPyBTTorrentBase",s,c)

if __name__ == "__main__":
    appname     = ""
    description = ""
    version     = ""

    KCmdLineArgs.init (sys.argv, appname, description, version)
    a = KApplication ()

    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
    w = KPyBTTorrentBase()
    a.setMainWidget(w)
    w.show()
    a.exec_loop()
开发者ID:BackupTheBerlios,项目名称:kpybt-svn,代码行数:32,代码来源:KPyBTTorrentBase.py

示例4: monitor

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import exec_loop [as 别名]
    """
    Monitor a file.
    
    @param  fileName    File to monitor
    """
    def monitor(self, fileName):
        try:
            tailer = Tail(fileName)
        except:
            KMessageBox.error(self, 
                str(i18n("Cannot open file for monitoring:\n%s")) % fileName,
                i18n("Error - lovi"))
            return
        self.tab.addTab(Monitor(tailer), os.path.basename(fileName))

"""
Main program.
"""
description = str(i18n("Simple log file viewer"))
version = "0.1"
about = KAboutData("", "", \
    version, description, KAboutData.License_GPL, \
    "(C) 2005 Akos Polster")
about.addAuthor("Akos Polster", "", "[email protected]")
KCmdLineArgs.init(sys.argv, about)
# KCmdLineArgs.addCmdLineOptions([("+files", "File to open")])
app = KApplication()
mainWindow = MainWin(None, "lovi#")
mainWindow.show()
app.exec_loop()
开发者ID:pipacs,项目名称:etc,代码行数:32,代码来源:tab.py


注:本文中的kdecore.KApplication.exec_loop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。