當前位置: 首頁>>代碼示例>>Python>>正文


Python EditorDialog.set_value方法代碼示例

本文整理匯總了Python中syncthing_gtk.EditorDialog.set_value方法的典型用法代碼示例。如果您正苦於以下問題:Python EditorDialog.set_value方法的具體用法?Python EditorDialog.set_value怎麽用?Python EditorDialog.set_value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在syncthing_gtk.EditorDialog的用法示例。


在下文中一共展示了EditorDialog.set_value方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: set_value

# 需要導入模塊: from syncthing_gtk import EditorDialog [as 別名]
# 或者: from syncthing_gtk.EditorDialog import set_value [as 別名]
	def set_value(self, key, value):
		if key == "Versioning":
			# Create structure if needed
			self.create_dicts(self.values, ("Versioning", "Type"))
			self.values["Versioning"]["Type"] = value
		elif key == "KeepVersions":
			# Create structure if needed
			self.create_dicts(self.values, ("Versioning", "Params", "keep"))
			self.values["Versioning"]["Params"]["keep"] = str(int(value))
		elif key == "MaxAge":
			# Create structure if needed
			self.create_dicts(self.values, ("Versioning", "Params", "maxAge"))
			self.values["Versioning"]["Params"]["maxAge"] = str(int(value) * 86400) # days to seconds
		elif key == "VersionsPath":
			# Create structure if needed
			self.create_dicts(self.values, ("Versioning", "Params", "versionsPath"))
			self.values["Versioning"]["Params"]["versionsPath"] = value
		elif key == "INotify":
			l = self.app.config["use_inotify"]
			if value:
				if not self.id in l:
					l.append(self.id)
			else:
				while self.id in l:
					l.remove(self.id)
			self.app.config["use_inotify"] = l
		else:
			EditorDialog.set_value(self, key, value)
開發者ID:LenzGr,項目名稱:syncthing-gtk,代碼行數:30,代碼來源:foldereditor.py

示例2: set_value

# 需要導入模塊: from syncthing_gtk import EditorDialog [as 別名]
# 或者: from syncthing_gtk.EditorDialog import set_value [as 別名]
	def set_value(self, key, value):
		if key == "autostart":
			set_run_on_startup(value, "Syncthing-GTK", get_executable(),
				"/usr/share/syncthing-gtk/icons/st-logo-128.png",
				"GUI for Syncthing")
		elif key == "daemon_priority":
			return EditorDialog.set_value(self, key, int(value))
		else:
			return EditorDialog.set_value(self, key, value)
開發者ID:Newman101,項目名稱:syncthing-gtk,代碼行數:11,代碼來源:uisettingsdialog.py

示例3: set_value

# 需要導入模塊: from syncthing_gtk import EditorDialog [as 別名]
# 或者: from syncthing_gtk.EditorDialog import set_value [as 別名]
	def set_value(self, key, value):
		if key == "ListenAddress":
			self.values[key] = [ x.strip() for x in value.split(",") ]
		elif key == "GlobalAnnServers":
			self.values[key] = [ x.strip() for x in value.split(",") ]
			if "GlobalAnnServer" in self.values:
				# For Syncthing < 0.9.10
				if len(self.values[key]) > 0:
					self.values["GlobalAnnServer"] = self.values[key][0]
				else:
					self.values["GlobalAnnServer"] = ""
		elif key == "URAccepted":
			self.values[key] = 1 if value else -1
		elif key == "MaxSendKbpsEnabled":
			if value:
				if self.values["MaxSendKbps"] <= 0:
					self.values["MaxSendKbps"] = 1
					self.find_widget_by_id("vMaxSendKbps").get_adjustment().set_value(self.values["MaxSendKbps"])
			else:
				self.values["MaxSendKbps"] = 0
				print "MaxSendKbpsEnabled : MaxSendKbps zeroed"
				self.find_widget_by_id("vMaxSendKbps").get_adjustment().set_value(self.values["MaxSendKbps"])
		elif key == "MaxRecvKbpsEnabled":
			if value:
				if self.values["MaxRecvKbps"] <= 0:
					self.values["MaxRecvKbps"] = 1
					self.find_widget_by_id("vMaxRecvKbps").get_adjustment().set_value(self.values["MaxRecvKbps"])
			else:
				self.values["MaxRecvKbps"] = 0
				self.find_widget_by_id("vMaxRecvKbps").get_adjustment().set_value(self.values["MaxRecvKbps"])
		else:
			return EditorDialog.set_value(self, key, value)
開發者ID:Rongya,項目名稱:syncthing-gtk,代碼行數:34,代碼來源:daemonsettings.py

示例4: set_value

# 需要導入模塊: from syncthing_gtk import EditorDialog [as 別名]
# 或者: from syncthing_gtk.EditorDialog import set_value [as 別名]
	def set_value(self, key, value):
		if key == "ListenAddress":
			self.values[key] = [ x.strip() for x in value.split(",") ]
		elif key == "URAccepted":
			self.values[key] = 1 if value else 0
		elif key == "MaxSendKbpsEnabled":
			if value:
				if self.values["MaxSendKbps"] <= 0:
					self.values["MaxSendKbps"] = 1
			else:
				self.values["MaxSendKbps"] = 0
			self.find_widget_by_id("vMaxSendKbps").get_adjustment().set_value(self.values["MaxSendKbps"])
		else:
			return EditorDialog.set_value(self, key, value)
開發者ID:bboerner,項目名稱:syncthing-gui,代碼行數:16,代碼來源:daemonsettings.py

示例5: set_value

# 需要導入模塊: from syncthing_gtk import EditorDialog [as 別名]
# 或者: from syncthing_gtk.EditorDialog import set_value [as 別名]
	def set_value(self, key, value):
		if key == "Addresses":
			self.values[key] = [ x.strip() for x in value.split(",") ]
		else:
			return EditorDialog.set_value(self, key, value)
開發者ID:Rongya,項目名稱:syncthing-gtk,代碼行數:7,代碼來源:deviceeditor.py


注:本文中的syncthing_gtk.EditorDialog.set_value方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。