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


Python PuddleConfig.set方法代码示例

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


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

示例1: applySettings

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
    def applySettings(self, *args):
        cparser = PuddleConfig(CONFIGPATH)
        fields = self.getItems()
        cparser.set('view_all_fields', 'fields', fields)

        if state:
            show_all_fields()
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:9,代码来源:__init__.py

示例2: changeProfile

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
 def changeProfile(self, index):
     try:
         self.profile = self.profiles[index]
     except IndexError:
         return
     cparser = PuddleConfig()
     cparser.set('masstagging', 'lastindex', index)
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:9,代码来源:dialogs.py

示例3: closeEvent

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
    def closeEvent(self, e):
        preview_msg = translate('Previews',
            'Some files have uncommited previews. '
            'These changes will be lost once you exit puddletag. <br />'
            'Do you want to exit without writing those changes?<br />')
        if tagmodel.has_previews(parent=self, msg=preview_msg):
            e.ignore()
            return False
        controls = PuddleDock._controls
        for control in PuddleDock._controls.values():
            if hasattr(control, 'saveSettings'):
                try:
                    control.saveSettings(self)
                except TypeError:
                    control.saveSettings()

        cparser = PuddleConfig()
        settings = QSettings(constants.QT_CONFIG, QSettings.IniFormat)
        if self._lastdir:
            cparser.set('main', 'lastfolder', unicode(self._lastdir[0], 'utf8'))
        cparser.set("main", "maximized", self.isMaximized())
        settings.setValue('main/state', QVariant(self.saveState()))

        headstate = self._table.horizontalHeader().saveState()
        settings.setValue('table/header', QVariant(headstate))
        genres.save_genres(status['genres'])
        e.accept()
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:29,代码来源:puddletag.py

示例4: applyPrefs

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
 def applyPrefs(self, values):
     musicdir = values[0]
     self.musicdir = musicdir
     cparser = PuddleConfig()
     cparser.set('exampletagsource', 'musicdir', musicdir)
     self.preferences[0][2] = musicdir
     isdir = os.path.isdir
     join = os.path.join
     musicdir = musicdir.encode('utf8')
     self._dirs = [z for z in os.listdir(musicdir) if isdir(join(musicdir,z))]
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:12,代码来源:example.py

示例5: applySettings

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
    def applySettings(self, control=None):
        cparser = PuddleConfig()
        x = lambda c: c.getRgb()[:-1]
        colors = [x(self.listbox.item(z,0).background().color())
            for z in range(self.listbox.rowCount())]
        cparser.set('table', 'selected_color', colors[0])
        cparser.set('table', 'preview_color', colors[1])
        cparser.set('extendedtags', 'add', colors[2])
        cparser.set('extendedtags', 'edit', colors[3])
        cparser.set('extendedtags', 'remove', colors[4])

        control.model().selectionBackground = QColor.fromRgb(*colors[0])
        control.model().previewBackground = QColor.fromRgb(*colors[1])
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:15,代码来源:puddlesettings.py

示例6: applySettings

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
    def applySettings(self, control = None):
        from puddlestuff.puddletag import remove_shortcuts, add_shortcuts
        remove_shortcuts('&Actions', self._names)

        f = open(FILENAME, 'w')
        f.close()
        
        cparser = PuddleConfig(FILENAME)
        for i, item in enumerate(self._listbox.items()):
            section = SHORTCUT_SECTION + unicode(i)
            cparser.set(section, NAME, item.actionName)
            cparser.set(section, FILENAMES, item.filenames)

        from puddlestuff.mainwin.funcs import applyaction

        shortcuts = create_action_shortcuts(applyaction, control)
        for item, shortcut in zip(self._listbox.items(), shortcuts):
            if item.shortcut:
                shortcut.setShortcut(item.shortcut)
        add_shortcuts('&Actions', shortcuts, save=True)
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:22,代码来源:action_shortcuts.py

示例7: save

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
def save(filename=None, confirmations=None):
    if filename is None:
        filename = _filename
    cparser = PuddleConfig(filename)
    
    if confirmations is None:
        confirmations = _confirmations
    
    for i, name in enumerate(confirmations):
        set_value = lambda k,v: cparser.set(SECTION + unicode(i), k, v)
        set_value(NAME, name)
        set_value(VALUE, confirmations[name][0])
        set_value(DESC, confirmations[name][1])
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:15,代码来源:confirmations.py

示例8: savesettings

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
def savesettings(d, filepath=None):
    settings = PuddleConfig()
    if filepath:
        settings.filename = filepath
    else:
        settings.filename = os.path.join(settings.savedir, 'tagpanel')
    settings.set('panel', 'numrows', unicode(len(d)))
    for row, rowtags in d.items():
        settings.set(unicode(row), 'tags', [z[1] for z in rowtags])
        settings.set(unicode(row), 'titles', [z[0] for z in rowtags])
开发者ID:keithgg,项目名称:puddletag,代码行数:12,代码来源:tagpanel.py

示例9: saveset

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
def saveset(setname, disp, algs, maintag):
    cparser = PuddleConfig()
    filename = os.path.join(DUPEDIR, setname)
    open(filename, 'w').close() #I have to clear the file because if a previous
                                #set had more algos then the extra algos will get loaded.
    cparser.filename = filename
    algs = [{'tags': a.tags, 'threshold': a.threshold,
            'func': a.func.__name__, 'matchcase': a.matchcase,
            'maintag': maintag} for a in algs]

    cparser.set('info', 'name', setname)
    cparser.set('info', 'disp', disp)
    for i, a in enumerate(algs):
        setname = u'alg' + unicode(i)
        for key, val in a.items():
            cparser.set(setname, key, val)
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:18,代码来源:algwin.py

示例10: save_shortcut

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
def save_shortcut(name, filenames):
    cparser = PuddleConfig(FILENAME)
    section = SHORTCUT_SECTION + unicode(len(cparser.sections()))
    cparser.set(section, NAME, name)
    cparser.set(section, FILENAMES, filenames)
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:7,代码来源:action_shortcuts.py

示例11: applySettings

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
 def applySettings(self, control=None):
     to_load = self.get_to_load()
     cparser = PuddleConfig()
     cparser.set('plugins', 'to_load', to_load)
开发者ID:chincheta0815,项目名称:puddletag,代码行数:6,代码来源:pluginloader.py

示例12: save_mtp

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
def save_mtp(mtp, filename=CONFIG):
    cparser = PuddleConfig(filename)
    info_section = 'info'

    cparser.set(info_section, NAME, mtp.name)
    for key in ['name', 'desc', 'file_pattern', 'fields',
        'jfdi', 'leave_existing']:
        cparser.set(info_section, key, getattr(mtp, key))

    for key in ['album_bound', 'track_bound']:
        cparser.set(info_section, key, int(getattr(mtp, key) * 100))

    cparser.set(info_section, 'numsources', len(mtp.profiles))
    for num, tsp in enumerate(mtp.profiles):
        section = 'config%s' % num
        name = tsp.tag_source.name if tsp.tag_source else u''
        cparser.set(section, 'source', name)
        cparser.set(section, 'if_no_result', tsp.if_no_result)
        cparser.set(section, 'fields', u','.join(tsp.fields))
        cparser.set(section, 'replace_fields', u','.join(tsp.replace_fields))
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:22,代码来源:config.py

示例13: saveSettings

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
 def saveSettings(self, actions):
     
     cparser = PuddleConfig(os.path.join(CONFIGDIR, 'user_shortcuts'))
     for action in actions:
         shortcut = unicode(action.shortcut().toString())
         cparser.set('shortcuts', unicode(action.text()), shortcut)
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:8,代码来源:shortcutsettings.py

示例14: save_gen_settings

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
def save_gen_settings(setlist):
    settings = PuddleConfig()
    settings.filename = os.path.join(settings.savedir, 'gensettings')
    for desc, value in setlist.items():
        settings.set(desc, 'value', value)
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:7,代码来源:puddlesettings.py

示例15: saveSettings

# 需要导入模块: from puddlestuff.puddleobjects import PuddleConfig [as 别名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import set [as 别名]
 def saveSettings(self):
     settings = PuddleConfig()
     settings.set('editor', 'patterns', self.items())
     settings.set('editor', 'index', self.currentIndex())
开发者ID:RaphaelRochet,项目名称:puddletag,代码行数:6,代码来源:patterncombo.py


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