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


Python KGlobal.config方法代码示例

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


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

示例1: removeShortcut

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
 def removeShortcut(self, name):
     """
     Deletes the given action if existing.
     """
     resolvedName = self.resolveName(name)
     action = self._collection.action(resolvedName)
     if action:
         action.deleteLater()
         KGlobal.config().group(self._manager.configGroup).deleteEntry(resolvedName)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:11,代码来源:shortcut.py

示例2: tabWidth

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
 def tabWidth(self):
     """Returns the width of the tab character in this document."""
     v = self.kateVariable("tab-width")
     if v and v.isdigit():
         return int(v)
     group = KGlobal.config().group("Kate Document Defaults")
     return group.readEntry("Tab Width", 8)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:9,代码来源:app.py

示例3: __init__

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
    def __init__(self, servicePrefix):
        # We manage our own documents.
        self.documents = []
        self.history = []       # latest shown documents

        # KApplication needs to be instantiated before any D-Bus stuff
        self.kapp = KApplication()
        
        # Here we can setup config() stuff before MainWindow and its tools 
        # are created.
        config = KGlobal.config().group("") # root group
        self.setupConfiguration(config)
        config.sync()
        
        # DBus init
        serviceName = "{0}{1}".format(servicePrefix, os.getpid())
        DBusItem.__init__(self, serviceName, '/MainApp')

        # We support only one MainWindow.
        self.mainwin = self.createMainWindow()
        self.kapp.setTopWidget(self.mainwin)

        # Get our beloved editor :-)
        self.editor = KTextEditor.EditorChooser.editor()
        self.editor.readConfig()

        # restore session etc.
        self._sessionStartedFromCommandLine = False
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:30,代码来源:app.py

示例4: indentationWidth

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
 def indentationWidth(self):
     """Returns the indent-width for the current document."""
     v = self.kateVariable("indent-width")
     if v and v.isdigit():
         return int(v)
     group = KGlobal.config().group("Kate Document Defaults")
     return group.readEntry("Indentation Width", 2)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:9,代码来源:app.py

示例5: saveOnRunWarning

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
def saveOnRunWarning():
    """ Copy old setting to the new save on run notification setting (1.1.2)"""
    c = KGlobal.config()
    group = c.group("preferences")
    if group.readEntry("save on run", False):
        group = c.group("Notification Messages")
        group.writeEntry("save_on_run", False)
        c.sync()
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:10,代码来源:install.py

示例6: run

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
 def run(self, sender=None):
     """
     Last minute setup and enter the KDE event loop.
     At the very last, instantiates one empty doc if nothing loaded yet.
     """
     if self.kapp.isSessionRestored():
         self.mainwin.restore(1, False)
     elif (len(self.documents) == 0
           and not self._sessionStartedFromCommandLine):
         # restore named session?
         action = config("preferences").readEntry("default session", "")
         if action == "lastused":
             self.mainwin.sessionManager().restoreLastSession()
         elif action == "custom":
             session = config("preferences").readEntry("custom session", "")
             if session in self.mainwin.sessionManager().names():
                 self.mainwin.sessionManager().switch(session)
     if len(self.documents) == 0:
         self.createDocument().setActive()
     sys.excepthook = self.handleException
     self.mainwin.show()
     self.kapp.exec_()
     KGlobal.config().sync()
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:25,代码来源:app.py

示例7: newLilyPondConfig

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
def newLilyPondConfig():
    """ Take old lilypond path preference over to new multi-version config (1.1.0) """
    c = KGlobal.config()
    group = c.group("lilypond")
    if not group.hasKey("default"):
        cmds = c.group("commands")
        lily = cmds.readEntry("lilypond", "lilypond")
        conv = cmds.readEntry("convert-ly", "convert-ly")
        if (os.path.isabs(lily) and os.path.isabs(conv)
            and os.path.dirname(lily) == os.path.dirname(conv)):
            conv = os.path.basename(conv)
        group.writeEntry("default", lily)
        group.writeEntry("paths", [lily])
        group = group.group(lily)
        group.writeEntry("convert-ly", conv)
        c.sync()
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:18,代码来源:install.py

示例8: config

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
def config(group="installertools"):
    return KGlobal.config().group(group)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:4,代码来源:download.py

示例9: config

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
def config(group):
    return KGlobal.config().group(group)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:4,代码来源:runlily.py

示例10: config

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
def config():
    return KGlobal.config().group("charselect")
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:4,代码来源:charselect.py

示例11: config

# 需要导入模块: from PyKDE4.kdecore import KGlobal [as 别名]
# 或者: from PyKDE4.kdecore.KGlobal import config [as 别名]
def config(group=None):
    c = KGlobal.config().group("scorewiz")
    if group:
        c = c.group(group)
    return c
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:7,代码来源:__init__.py


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