本文整理汇总了Python中syncthing_gtk.editordialog.EditorDialog.get_value方法的典型用法代码示例。如果您正苦于以下问题:Python EditorDialog.get_value方法的具体用法?Python EditorDialog.get_value怎么用?Python EditorDialog.get_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类syncthing_gtk.editordialog.EditorDialog
的用法示例。
在下文中一共展示了EditorDialog.get_value方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_value
# 需要导入模块: from syncthing_gtk.editordialog import EditorDialog [as 别名]
# 或者: from syncthing_gtk.editordialog.EditorDialog import get_value [as 别名]
def get_value(self, key):
if key == "addresses":
return ",".join([strip_v(x) for x in self.values[key]])
elif key == "compression":
val = EditorDialog.get_value(self, key)
# For syncthing <= 0.10.25
if val in (True, "true"):
return "always"
elif val in (False, "false"):
return "never"
else:
return val
else:
return EditorDialog.get_value(self, key)
示例2: get_value
# 需要导入模块: from syncthing_gtk.editordialog import EditorDialog [as 别名]
# 或者: from syncthing_gtk.editordialog.EditorDialog import get_value [as 别名]
def get_value(self, key):
if key == "keepVersions":
return self.get_burried_value("versioning/params/keep", self.values, 0, int)
elif key == "maxAge":
return self.get_burried_value("versioning/params/maxAge", self.values, 0, int) / 86400 # seconds to days
elif key == "versionsPath":
return self.get_burried_value("versioning/params/versionsPath", self.values, "")
elif key == "versioning":
return self.get_burried_value("versioning/type", self.values, "")
elif key == "inotify":
return self.id in self.app.config["use_inotify"]
else:
return EditorDialog.get_value(self, key)
示例3: get_value
# 需要导入模块: from syncthing_gtk.editordialog import EditorDialog [as 别名]
# 或者: from syncthing_gtk.editordialog.EditorDialog import get_value [as 别名]
def get_value(self, key):
if key == "listenAddresses":
return ", ".join([ strip_v(x) for x in self.values[key]])
elif key == "globalAnnounceServers":
return ", ".join([ strip_v(x) for x in self.values["globalAnnounceServers"]])
elif key == "urAccepted":
return (self.values["urAccepted"] == 1)
elif key == "maxSendKbpsEnabled":
return (self.values["maxSendKbps"] != 0)
elif key == "maxRecvKbpsEnabled":
return (self.values["maxRecvKbps"] != 0)
else:
return EditorDialog.get_value(self, key)
示例4: get_value
# 需要导入模块: from syncthing_gtk.editordialog import EditorDialog [as 别名]
# 或者: from syncthing_gtk.editordialog.EditorDialog import get_value [as 别名]
def get_value(self, key):
if key == "keepVersions":
return self.get_burried_value("versioning/params/keep", self.values, 0, int)
elif key == "maxAge":
return self.get_burried_value("versioning/params/maxAge", self.values, 0, int) / 86400 # seconds to days
elif key == "cleanoutDays":
return self.get_burried_value("versioning/params/cleanoutDays", self.values, 0, int)
elif key == "command":
return self.get_burried_value("versioning/params/command", self.values, "")
elif key == "versionsPath":
return self.get_burried_value("versioning/params/versionsPath", self.values, "")
elif key == "readOnly":
return self.get_burried_value("type", self.values, "") in ("readonly", "sendonly")
elif key == "receiveOnly":
return self.get_burried_value("type", self.values, "") in ("receiveonly")
elif key == "versioning":
return self.get_burried_value("versioning/type", self.values, "")
else:
return EditorDialog.get_value(self, key)
示例5: get_value
# 需要导入模块: from syncthing_gtk.editordialog import EditorDialog [as 别名]
# 或者: from syncthing_gtk.editordialog.EditorDialog import get_value [as 别名]
def get_value(self, key):
if key == "autostart":
return is_ran_on_startup("Syncthing-GTK")
else:
return EditorDialog.get_value(self, key)