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


Python Config.set_and_save方法代码示例

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


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

示例1: page3_add

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
 def page3_add (self, *args):
     m, iter = self.s3a.get_selected()
     if iter:
         p = self.sfm.convert_iter_to_child_iter(None, iter)
         field = self.fm[p] [3]
         self.current_entry.optional.append(field)
         self.sm.append ((field.name, False, field.name, field))
         Config.set_and_save('base/entries', self.entries)
     self.check()
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:11,代码来源:Fields.py

示例2: page2_rm

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
 def page2_rm (self, *args):
     self.check()
     m, iter = self.s2.get_selected()
     if iter:
         p = self.sem.convert_iter_to_child_iter(None, iter)
         del self.entries [self.em[p] [2]]
         self.em.remove(p)
         Config.set_and_save('base/entries', self.entries)
         self.check()
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:11,代码来源:Fields.py

示例3: page1_rm

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
 def page1_rm (self, *args):
     m, iter = self.s1.get_selected()
     if iter:
         p = self.sfm.convert_iter_to_child_iter(None, iter)
         #print 'SELF:FM[P][2]:', self.fm[p] [2]
         try: del self.fields [self.fm[p][2]]
         except KeyError: pass
         self.fm.remove(p)
         Config.set_and_save('base/fields', self.fields)
         self.check()
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:12,代码来源:Fields.py

示例4: apply

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
    def apply (self, * arg):
        if not self.changed: return
        
        result = self.get ()
        
        Config.set_and_save ('base/fields', result)

        if self.parent:
            self.parent.warning (_("Some changes require to restart Pybliographic\n"
                                   "to be correctly taken into account"))
        return
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:13,代码来源:Fields.py

示例5: update

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
 def update (self, force=False, *args):
     """Call this with an additional parameter
     force=True if the widget does nor use changed()."""
     #print 'UPDATE:', self.key, self.get(), force
     if not (force or self.state ()): return 0
     if self.key:
         Config.set_and_save (self.key, self.get ())
         self.prop.changed()
     else:
         self.parent.update(force = force)
     return False
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:13,代码来源:Config.py

示例6: page3_rm

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
 def page3_rm (self, *args):
     m, iter = self.s3b.get_selected()
     if iter:
         p = self.ssm.convert_iter_to_child_iter (None, iter)
         field = self.sm[p] [3]
         if self.sm[p] [1]:
             self.current_entry.mandatory.remove(field)
         else:
             self.current_entry.optional.remove(field)
         del self.sm [p]
         Config.set_and_save('base/entries', self.entries)
     self.check()
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:14,代码来源:Fields.py

示例7: toggle_mandatory

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
 def toggle_mandatory (self, rend, path):
     p = self.ssm.convert_path_to_child_path(path)
     iter = self.sm.get_iter(p)
     field = self.sm[iter][3]
     x = self.sm.get_value (iter, 1)
     self.sm.set_value(iter, 1, not x)
     if x:
         self.current_entry.mandatory.remove(field)
         self.current_entry.optional.append(field)
     else:
         self.current_entry.optional.remove(field)
         self.current_entry.mandatory.append(field)
     self.entries [self.current_entry.name.lower()] = self.current_entry
     Config.set_and_save ('base/entries', self.entries)
     self.check()
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:17,代码来源:Fields.py

示例8: on_name2_changed

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
 def on_name2_changed (self, *args):
     sel = self.entries2.get_selection()
     m, iter = sel.get_selected()
     if iter:
         p = self.sem.convert_iter_to_child_iter(None, iter)
         newname = self.name2.get_text()
         try: del self.entries [self.em[p][2]]
         except KeyError: print 'Keyerror', self.em[
             p] [2], self.entries.keys()
         self.em[p][1].name = newname
         self.em[p][0] = newname
         self.em[p][2] = newname.lower()
         self.entries[newname.lower()] = self.em[p][1]
         Config.set_and_save ('base/entries', self.entries)
     self.check()
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:17,代码来源:Fields.py

示例9: change_fields

# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import set_and_save [as 别名]
 def change_fields (self, item=None):
     Config.set_and_save('base/fields', self.fields)
开发者ID:zkota,项目名称:pyblio-1.3,代码行数:4,代码来源:Fields.py


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