本文整理匯總了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)