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


Python Server.notifywithemail方法代码示例

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


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

示例1: post

# 需要导入模块: from models import Server [as 别名]
# 或者: from models.Server import notifywithemail [as 别名]
	def post(self):	
		server = Server(key_name=self.request.get('serverdomain'))
		server.serverdomain = self.request.get('serverdomain')
		if self.request.get('ssl') == "True":
			server.ssl = True
		else:
			server.ssl = False
		if self.request.get('notifywithprowl') == "True":
			server.notifywithprowl = True
		if self.request.get('notifywithemail') == "True":
			server.notifywithemail = True
		#server.notifywithprowl = self.request.get('notifywithtwitter')
		server.email = users.get_current_user().email()
		server.put()
		self.redirect('/admin')
开发者ID:JoshuaEstes,项目名称:aeservmon,代码行数:17,代码来源:admin.py

示例2: getServer

# 需要导入模块: from models import Server [as 别名]
# 或者: from models.Server import notifywithemail [as 别名]
def getServer(self):
	serverdomain = self.request.get('serverdomain')
	server_ssl = False

	url = "http"
	if self.request.get('ssl') == "True":
		server_ssl = True
		url += "s"
	url += "://%s" % serverdomain

	notifywithprowl = self.request.get('notifywithprowl')
	notifywithemail = self.request.get('notifywithemail')
	parser = self.request.get('parser')
	parsermetadata = self.request.get('parsermetadata')
	
	# Figure out the key.
	keyvalue = "%s_%s_%s" % (url, parser, parsermetadata)
	if notifywithprowl:
		keyvalue += "_Y"
	else:
		keyvalue += "_N"
	if notifywithemail:
		keyvalue += "_Y"
	else:
		keyvalue += "_N"
	
	server = Server(key_name=keyvalue)
	server.url = url
	server.serverdomain = serverdomain
	server.ssl = server_ssl

	if notifywithprowl == "True":
		server.notifywithprowl = True
	if notifywithemail == "True":
		server.notifywithemail = True

	#server.notifywithtwitter = self.request.get('notifywithtwitter')
	server.parser = parser
	server.parsermetadata = parsermetadata
	
	server.email = users.get_current_user().email()
	return server
开发者ID:tkawachi,项目名称:aeservmon,代码行数:44,代码来源:admin.py


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