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()
示例#2
0
# See http://www.gnu.org/licenses/ for more information.

"""
A Log Window.
On first import a tool view is created.
"""

import kate

from qt import QWidget

from lilykde.widgets import LogWidget

# Translate the messages
from lilykde.i18n import _


tool = kate.gui.Tool(_("LilyPond Log"), "log", kate.gui.Tool.bottom)
log = LogWidget(tool.widget)
log.setFocusPolicy(QWidget.NoFocus)
log.show()
tool.show()

# make these easily available
show = tool.show
hide = tool.hide
clear = log.clear

def logWidget():
    return log