本文整理汇总了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()
示例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()
示例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()
示例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()