本文整理汇总了Python中simple_config.SimpleConfig.save_config方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleConfig.save_config方法的具体用法?Python SimpleConfig.save_config怎么用?Python SimpleConfig.save_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simple_config.SimpleConfig
的用法示例。
在下文中一共展示了SimpleConfig.save_config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MiniWindow
# 需要导入模块: from simple_config import SimpleConfig [as 别名]
# 或者: from simple_config.SimpleConfig import save_config [as 别名]
#.........这里部分代码省略.........
show_about.triggered.connect(self.show_about)
main_layout.setMenuBar(menubar)
quit_shortcut = QShortcut(QKeySequence("Ctrl+Q"), self)
quit_shortcut.activated.connect(self.close)
close_shortcut = QShortcut(QKeySequence("Ctrl+W"), self)
close_shortcut.activated.connect(self.close)
self.cfg = SimpleConfig()
g = self.cfg.config["winpos-lite"]
self.setGeometry(g[0], g[1], g[2], g[3])
show_history.setChecked(self.cfg.config["history"])
self.show_history(self.cfg.config["history"])
self.setWindowIcon(QIcon(":electrum.png"))
self.setWindowTitle("Electrum")
self.setWindowFlags(Qt.Window|Qt.MSWindowsFixedSizeDialogHint)
self.layout().setSizeConstraint(QLayout.SetFixedSize)
self.setObjectName("main_window")
self.show()
def toggle_theme(self, theme_name):
old_path = QDir.currentPath()
self.actuator.change_theme(theme_name)
# Recompute style globally
qApp.style().unpolish(self)
qApp.style().polish(self)
QDir.setCurrent(old_path)
def closeEvent(self, event):
g = self.geometry()
self.cfg.set_key("winpos-lite", [g.left(),g.top(),g.width(),g.height()])
self.cfg.set_key("history", self.history_list.isVisible())
self.cfg.save_config()
super(MiniWindow, self).closeEvent(event)
qApp.quit()
def set_payment_fields(self, dest_address, amount):
self.address_input.setText(dest_address)
self.address_field_changed(dest_address)
self.amount_input.setText(amount)
def activate(self):
pass
def deactivate(self):
pass
def set_quote_currency(self, currency):
"""Set and display the fiat currency country."""
assert currency in self.quote_currencies
self.quote_currencies.remove(currency)
self.quote_currencies.insert(0, currency)
self.refresh_balance()
def change_quote_currency(self):
self.quote_currencies = \
self.quote_currencies[1:] + self.quote_currencies[0:1]
self.actuator.set_config_currency(self.quote_currencies[0])
self.refresh_balance()
def refresh_balance(self):
if self.btc_balance is None:
# Price has been discovered before wallet has been loaded
# and server connect... so bail.