• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python webnotes.destroy函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中webnotes.destroy函数的典型用法代码示例。如果您正苦于以下问题:Python destroy函数的具体用法?Python destroy怎么用?Python destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: set_admin_password

def set_admin_password(admin_password, site=None):
	import webnotes
	webnotes.connect(site=site)
	webnotes.conn.sql("""update __Auth set `password`=password(%s)
		where user='Administrator'""", (admin_password,))
	webnotes.conn.commit()
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:7,代码来源:wnf.py


示例2: clear_web

def clear_web(site=None):
	import webnotes.webutils
	webnotes.connect(site=site)
	from website.doctype.website_sitemap_config.website_sitemap_config import build_website_sitemap_config
	build_website_sitemap_config()
	webnotes.webutils.clear_cache()
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:7,代码来源:wnf.py


示例3: patch

def patch(patch_module, site=None, force=False):
	import webnotes.modules.patch_handler
	webnotes.connect(site=site)
	webnotes.local.patch_log_list = []
	webnotes.modules.patch_handler.run_single(patch_module, force=force)
	print "\n".join(webnotes.local.patch_log_list)
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:7,代码来源:wnf.py


示例4: mysql

def mysql(site=None):
	import webnotes 
	import commands, os
	msq = commands.getoutput('which mysql')
	webnotes.init(site=site)
	os.execv(msq, [msq, '-u', webnotes.conf.db_name, '-p'+webnotes.conf.db_password, webnotes.conf.db_name, '-h', webnotes.conf.db_host or "localhost", "-A"])
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:7,代码来源:wnf.py


示例5: make_conf

def make_conf(db_name=None, db_password=None, site=None, site_config=None):
	try:
		from werkzeug.exceptions import NotFound
		import conf
		
		try:
			webnotes.init(site=site)
		except NotFound:
			pass
		
		if not site and webnotes.conf.site:
			site = webnotes.conf.site
			
		if site:
			# conf exists and site is specified, create site_config.json
			make_site_config(site, db_name, db_password, site_config)
		elif os.path.exists("conf.py"):
			print "conf.py exists"
		else:
			# pyc file exists but py doesn't
			raise ImportError
			
	except ImportError:
		if site:
			raise Exception("conf.py does not exist")
		else:
			# create conf.py
			with open(os.path.join("lib", "conf", "conf.py"), "r") as confsrc:
				with open("conf.py", "w") as conftar:
					conftar.write(confsrc.read() % get_conf_params(db_name, db_password))
	
	webnotes.destroy()
	webnotes.init(site=site)
开发者ID:ricardomomm,项目名称:wnframework,代码行数:33,代码来源:install.py


示例6: request

def request(args):
	import webnotes.handler
	webnotes.connect()
	webnotes.form_dict = webnotes._dict([a.split("=") for a in args.split("&")])
	webnotes.handler.execute_cmd(webnotes.form_dict.cmd)
	print webnotes.response
	webnotes.destroy()
开发者ID:bindscha,项目名称:wnframework_old,代码行数:7,代码来源:cli.py


示例7: reset_perms

def reset_perms(site=None):
	webnotes.connect(site=site)
	for d in webnotes.conn.sql_list("""select name from `tabDocType`
		where ifnull(istable, 0)=0 and ifnull(custom, 0)=0"""):
			webnotes.clear_cache(doctype=d)
			webnotes.reset_perms(d)
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:7,代码来源:wnf.py


示例8: domain

def domain(host_url=None, site=None):
	webnotes.connect(site=site)
	if host_url:
		webnotes.conn.set_value("Website Settings", None, "subdomain", host_url)
		webnotes.conn.commit()
	else:
		print webnotes.conn.get_value("Website Settings", None, "subdomain")
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:8,代码来源:wnf.py


示例9: run_scheduler

def run_scheduler():
	from webnotes.utils.file_lock import create_lock, delete_lock
	import webnotes.utils.scheduler
	if create_lock('scheduler'):
		webnotes.connect()
		print webnotes.utils.scheduler.execute()
		delete_lock('scheduler')
	webnotes.destroy()
开发者ID:bindscha,项目名称:wnframework_old,代码行数:8,代码来源:cli.py


示例10: run_scheduler

def run_scheduler(site=None):
	from webnotes.utils.file_lock import create_lock, delete_lock
	import webnotes.utils.scheduler
	webnotes.init(site=site)
	if create_lock('scheduler'):
		webnotes.connect(site=site)
		print webnotes.utils.scheduler.execute()
		delete_lock('scheduler')
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:9,代码来源:wnf.py


示例11: python

def python(site):
	import webnotes 
	import commands, os
	python = commands.getoutput('which python')
	if site:
		os.environ["site"] = site
	os.environ["PYTHONSTARTUP"] = os.path.join(os.path.dirname(webnotes.__file__), "pythonrc.py")
	os.execv(python, [python])
	webnotes.destroy()
开发者ID:bindscha,项目名称:wnframework_old,代码行数:9,代码来源:cli.py


示例12: install

def install(db_name, root_login="root", root_password=None, source_sql=None,
		admin_password = 'admin', verbose=True, force=False, site_config=None, reinstall=False):
	print db_name, source_sql
	from webnotes.installer import install_db, install_app, make_site_dirs
	install_db(root_login=root_login, root_password=root_password, db_name=db_name, source_sql=source_sql,
		admin_password = admin_password, verbose=verbose, force=force, site_config=site_config, reinstall=reinstall)
	make_site_dirs()
	install_app("webnotes", verbose=verbose)
	webnotes.destroy()
开发者ID:bindscha,项目名称:wnframework_old,代码行数:9,代码来源:cli.py


示例13: get_remote_and_branch

def get_remote_and_branch(remote=None, branch=None):
	if not (remote and branch):
		if not webnotes.conf.branch:
			raise Exception("Please specify remote and branch")
			
		remote = remote or "origin"
		branch = branch or webnotes.conf.branch
		webnotes.destroy()
		
	return remote, branch
开发者ID:bindscha,项目名称:wnframework_old,代码行数:10,代码来源:cli.py


示例14: backup

def backup(site=None, with_files=False, verbose=True, backup_path_db=None, backup_path_files=None):
	from webnotes.utils.backups import scheduled_backup
	webnotes.connect(site=site)
	odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files)
	if verbose:
		from webnotes.utils import now
		print "database backup taken -", odb.backup_path_db, "- on", now()
		if with_files:
			print "files backup taken -", odb.backup_path_files, "- on", now()
	webnotes.destroy()
	return odb
开发者ID:Halfnhav,项目名称:wnframework,代码行数:11,代码来源:wnf.py


示例15: update_site_config

def update_site_config(site_config, verbose=False):
	import json
	
	if isinstance(site_config, basestring):
		site_config = json.loads(site_config)
	
	config = webnotes.get_site_config()
	config.update(site_config)
	site_config_path = os.path.join(webnotes.local.site_path, "site_config.json")
	
	with open(site_config_path, "w") as f:
		json.dump(config, f, indent=1, sort_keys=True)
		
	webnotes.destroy()
开发者ID:bindscha,项目名称:wnframework_old,代码行数:14,代码来源:cli.py


示例16: update_site_config

def update_site_config(site_config, site, verbose=False):
	import json
	
	if isinstance(site_config, basestring):
		site_config = json.loads(site_config)
	
	webnotes.init(site=site)
	webnotes.conf.site_config.update(site_config)
	site_config_path = webnotes.get_conf_path(webnotes.conf.sites_dir, site)
	
	with open(site_config_path, "w") as f:
		json.dump(webnotes.conf.site_config, f, indent=1, sort_keys=True)
		
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:14,代码来源:wnf.py


示例17: move

def move(dest_dir=None):
	import os
	if not dest_dir:
		raise Exception, "--dest_dir is required for --move"
	if not os.path.isdir(dest_dir):
		raise Exception, "destination is not a directory or does not exist"

	old_path = webnotes.utils.get_site()
	new_path = os.path.join(dest_dir, site)

	# check if site dump of same name already exists
	site_dump_exists = True
	count = 0
	while site_dump_exists:
		final_new_path = new_path + (count and str(count) or "")
		site_dump_exists = os.path.exists(final_new_path)
		count = int(count or 0) + 1

	os.rename(old_path, final_new_path)
	webnotes.destroy()
	return os.path.basename(final_new_path)
开发者ID:bindscha,项目名称:wnframework_old,代码行数:21,代码来源:cli.py


示例18: get_site_status

def get_site_status(site=None, verbose=False):
	import webnotes
	import webnotes.utils
	from webnotes.profile import get_system_managers
	from core.doctype.profile.profile import get_total_users, get_active_users, \
		get_website_users, get_active_website_users
	
	import json
	webnotes.connect(site=site)
	ret = {
		'last_backup_on': webnotes.local.conf.last_backup_on,
		'active_users': get_active_users(),
		'total_users': get_total_users(),
		'active_website_users': get_active_website_users(),
		'website_users': get_website_users(),
		'system_managers': "\n".join(get_system_managers()),
		'default_company': webnotes.conn.get_default("company"),
		'disk_usage': webnotes.utils.get_disk_usage(),
		'working_directory': webnotes.utils.get_base_path()
	}
	
	# country, timezone, industry
	control_panel_details = webnotes.conn.get_value("Control Panel", "Control Panel", 
		["country", "time_zone", "industry"], as_dict=True)
	if control_panel_details:
		ret.update(control_panel_details)
	
	# basic usage/progress analytics
	for doctype in ("Company", "Customer", "Item", "Quotation", "Sales Invoice",
		"Journal Voucher", "Stock Ledger Entry"):
			key = doctype.lower().replace(" ", "_") + "_exists"
			ret[key] = 1 if webnotes.conn.count(doctype) else 0
			
	webnotes.destroy()
	
	if verbose:
		print json.dumps(ret, indent=1, sort_keys=True)
	
	return ret
开发者ID:Halfnhav,项目名称:wnframework,代码行数:39,代码来源:wnf.py


示例19: rebuild_sitemap

def rebuild_sitemap(site=None):
	from website.doctype.website_sitemap_config.website_sitemap_config import rebuild_website_sitemap_config
	webnotes.connect(site=site)
	rebuild_website_sitemap_config()
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:5,代码来源:wnf.py


示例20: make_custom_server_script

def make_custom_server_script(doctype, site=None):
	from core.doctype.custom_script.custom_script import make_custom_server_script_file
	webnotes.connect(site=site)
	make_custom_server_script_file(doctype)
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:5,代码来源:wnf.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python webnotes.doc函数代码示例发布时间:2022-05-26
下一篇:
Python webnotes.delete_doc函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap