本文整理匯總了Python中kdecore.KApplication.config方法的典型用法代碼示例。如果您正苦於以下問題:Python KApplication.config方法的具體用法?Python KApplication.config怎麽用?Python KApplication.config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kdecore.KApplication
的用法示例。
在下文中一共展示了KApplication.config方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from kdecore import KApplication [as 別名]
# 或者: from kdecore.KApplication import config [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()