當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。