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


Python KAboutData.setCustomAuthorText方法代码示例

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


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

示例1: make_about_data

# 需要导入模块: from PyKDE4.kdecore import KAboutData [as 别名]
# 或者: from PyKDE4.kdecore.KAboutData import setCustomAuthorText [as 别名]
def make_about_data(description):
    """
    Create an about data object describing synaptiks.

    ``description`` is a :class:`~PyKDE4.kdecore.KLocalizedString` containing a
    description for the specific part of synaptiks, the created about data
    object should describe.

    Return a :class:`~PyKDE4.kdecore.KAboutData` object with the given
    ``description``.
    """
    about = KAboutData(
        b'synaptiks', '', ki18nc('Program name', 'synaptiks'),
        str(synaptiks.__version__), description, KAboutData.License_BSD,
        ki18nc('About data copyright',
               # KLocalizedString doesn't deal well with unicode
               b'Copyright © 2009, 2010, 2011 Sebastian Wiesner'))
    about.setCustomAuthorText(
        ki18nc('custom author text plain text',
               'Please report bugs to the issue tracker at %1').subs(
            synaptiks.ISSUE_TRACKER_URL),
        ki18nc('@info custom author text rich text',
               'Please report bugs to the '
               '<link url="%1">issue tracker</link>.').subs(
            synaptiks.ISSUE_TRACKER_URL))
    about.setHomepage(synaptiks.WEBSITE_URL)
    about.setOrganizationDomain('lunaryorn.de')

    about.setTranslator(ki18nc('NAME OF TRANSLATORS', 'Your names'),
                        ki18nc('EMAIL OF TRANSLATORS', 'Your emails'))
    about.addAuthor(ki18nc('author name', 'Sebastian Wiesner'),
                    ki18nc('author task', 'Maintainer'),
                    '[email protected]')
    about.addCredit(ki18nc('credit name', 'Valentyn Pavliuchenko'),
                    ki18nc('credit task', 'Debian packaging, russian '
                           'translation, bug reporting and testing'),
                    '[email protected]')
    return about
开发者ID:adaptee,项目名称:synaptiks,代码行数:40,代码来源:__init__.py

示例2: run

# 需要导入模块: from PyKDE4.kdecore import KAboutData [as 别名]
# 或者: from PyKDE4.kdecore.KAboutData import setCustomAuthorText [as 别名]
def run():
    appName     = "eclectus"
    catalog     = "eclectusqt"
    programName = ki18n("Eclectus")
    version     = eclectusqt.__version__
    description = ki18n("Han character dictionary")
    license     = KAboutData.License_GPL_V3
    copyright   = ki18n("(c) 2008-2009 Christoph Burgmer")
    text        = ki18n(
        "Eclectus is a small Han character dictionary for learners.")
    homePage    = eclectusqt.__url__
    bugEmail    = "[email protected]"

    bugAddress = "http://code.google.com/p/eclectus/issues/list"
    aboutData = KAboutData(appName, catalog, programName, version, description,
        license, copyright, text, homePage, bugEmail)
    aboutData.addAuthor(ki18n("Christoph Burgmer"), ki18n("Developer"),
        "[email protected]", "http://cburgmer.nfshost.com/")
    aboutData.setCustomAuthorText(ki18n("Please use %1 to report bugs.")\
            .subs(bugAddress),
        ki18n('Please use %1 to report bugs.')\
            .subs('<a href="%s">%s</a>' % (bugAddress, bugAddress)))
    aboutData.addCredit(KLocalizedString(), ki18n("Arrr, Eclectus sits on the shoulders of some fine pirates:"))
    aboutData.addCredit(ki18n("Jim Breen and contributors"), ki18n("EDICT"), '',
        'http://www.csse.monash.edu.au/~jwb/j_edict.html')
    aboutData.addCredit(ki18n("Paul Denisowski and current contributors"),
        ki18n("CEDICT"), '', 'http://www.mdbg.net/chindict/chindict.php')
    aboutData.addCredit(ki18n("HanDeDict team"), ki18n("HanDeDict"), '',
        'http://www.chinaboard.de/chinesisch_deutsch.php')
    aboutData.addCredit(ki18n("Tomoe developers"),
        ki18n("Tomoe handwriting recognition"),
        '[email protected]', 'http://tomoe.sourceforge.jp')
    aboutData.addCredit(ki18n("Mathieu Blondel and the Tegaki contributors"),
        ki18n("Tegaki handwriting recognition"),
        u'mathieu ÂT mblondel DÔT org'.encode('utf8'),
        'http://tegaki.sourceforge.net')
    aboutData.addCredit(ki18n("Unicode Consortium and contributors"),
        ki18n("Unihan database"), '', 'http://unicode.org/charts/unihan.html')
    aboutData.addCredit(ki18n("Commons Stroke Order Project"),
        ki18n("Stroke order pictures"), '',
        'http://commons.wikimedia.org/wiki/Commons:Stroke_Order_Project')
    aboutData.addCredit(ki18n("Tim Eyre, Ulrich Apel and the Wadoku Project"),
        ki18n("Kanji stroke order font"), '',
        'http://sites.google.com/site/nihilistorguk/')
    aboutData.addCredit(
        ki18n("Yue Tan, Wei Gao, Vion Nicolas and the Shtooka Project"),
        ki18n("Pronunciation examples for Mandarin"), '',
        'http://shtooka.net')

    # find logo file, don't directly use util.getData(), KApplication not
    #   created yet
    aboutLogoFile = u'/usr/share/kde4/apps/eclectus/eclectus_about.png'
    if not os.path.exists(aboutLogoFile):
        modulePath = os.path.dirname(os.path.abspath(__file__))
        aboutLogoFile = os.path.join(modulePath, 'data', 'eclectus_about.png')
        if not os.path.exists(aboutLogoFile):
            aboutLogoFile = util.getData('eclectus_about.png')
    if aboutLogoFile:
        aboutData.setProgramLogo(QVariant(QImage(aboutLogoFile)))

    KCmdLineArgs.init(sys.argv, aboutData)

    # create applicaton
    global g_app
    g_app = KApplication()

    # TODO how to access local .mo file?
    #base = os.path.dirname(os.path.abspath(__file__))
    #localeDir = os.path.join(base, "locale")
    #print localeDir
    #if os.path.exists(localeDir):
        #print KGlobal.dirs().addResourceDir('locale', localeDir + '/', True)
    #print KGlobal.dirs().findResource('locale', 'de/LC_MESSAGES/eclectusqt.mo')

    # read config file and make global
    global GeneralConfig
    global DictionaryConfig
    global PluginConfig
    config = KConfig()
    GeneralConfig = KConfigGroup(config, "General")
    DictionaryConfig = KConfigGroup(config, "Dictionary")
    PluginConfig = KConfigGroup(config, "Plugin")

    # create main window
    MainWindow().show()

    # react to CTRL+C on the command line
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    g_app.exec_()
开发者ID:cburgmer,项目名称:eclectus,代码行数:92,代码来源:main.py


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