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


Python install.Installer类代码示例

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


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

示例1: make_master

def make_master():
	"""
		restore the master in a tmp database, run patches and export it
	"""
	# restore the master
	print "Importing master..."

	from webnotes.install_lib.install import Installer
	import webnotes

	# unzip master
	os.system("gunzip %s" % os.path.join(erpnext_path, 'master.sql.gz'))

	installer = Installer('root', root_password)
	installer.import_from_db('_tmpmaster', os.path.join(erpnext_path,'master.sql'))

	# run patches
	run_patches()

	# export db
	print "Taking fresh dump..."
	mysql_dump()

	# drop db
	print "Cleaning up..."
	webnotes.conn.sql("drop database _tmpmaster")
	os.remove(os.path.join(erpnext_path, 'master.sql'))
开发者ID:ranjithtenz,项目名称:erpnext-package-builder,代码行数:27,代码来源:build.py

示例2: setup_db

def setup_db(install_path, root_password, db_name):
	from webnotes.install_lib.install import Installer
	inst = Installer("root", root_password)
	inst.import_from_db(db_name, verbose=1)

	# run patches and sync
	exec_in_shell("./lib/wnf.py --patch_sync_build")
开发者ID:BANSALJEE,项目名称:erpnext,代码行数:7,代码来源:install_erpnext.py

示例3: setup_db

def setup_db(path, root_pwd, db_name):
	source = os.path.join(path, 'app', "master.sql")
	execute_in_shell("gunzip -c %s.gz > %s" % (source, source), verbose=1)

	from webnotes.install_lib.install import Installer
	inst = Installer('root', root_pwd)
	inst.import_from_db(db_name, source_path=source, verbose = 1)
	execute_in_shell("rm %s" % source)
开发者ID:jacara,项目名称:erpclone,代码行数:8,代码来源:install_erpnext.py

示例4: setup_db

def setup_db(install_path, root_password, db_name):
	master_sql = os.path.join(install_path, "app", "master.sql")
	exec_in_shell("gunzip -c %s.gz > %s" % (master_sql, master_sql))
	
	from webnotes.install_lib.install import Installer
	inst = Installer("root", root_password)
	inst.import_from_db(db_name, source_path=master_sql, verbose=1)

	exec_in_shell("rm -f %s" % (master_sql,))
	
	# run patches and sync
	exec_in_shell("./lib/wnf.py -b --no_cms")
	exec_in_shell("./lib/wnf.py --patch_sync_build")
开发者ID:kmmastermind,项目名称:erpnext,代码行数:13,代码来源:install_erpnext.py

示例5: restore_db

def restore_db():
    """
		import the database
	"""
    sys.path.append(os.path.join("wnframework", "cgi-bin"))

    import webnotes
    from webnotes.db import Database
    from webnotes.install_lib.install import Installer

    global db_name

    root_password = raw_input("Root password for mysql (for db and user creation):")

    inst = Installer("root", root_password)

    # gunzip
    os.system("gunzip -c %s > master.sql" % os.path.join("erpnext", "master.sql.gz"))

    # import
    print "Importing database..."
    inst.import_from_db(db_name, "master.sql")

    # cleanup
    webnotes.conn = Database("localhost", "root", root_password)
    webnotes.conn.use(db_name)
    webnotes.conn.begin()
    webnotes.conn.set_value(
        "Control Panel",
        None,
        "company_name",
        raw_input("[ERPNext setup] Enter the name of the full name of your company:"),
    )
    webnotes.conn.sql("delete from tabSingles where field='sync_with_gateway'")
    webnotes.conn.commit()
    os.remove("master.sql")

    # copy icons
    if not os.path.exists(os.path.join("wnframework", "images", "user")):
        os.mkdir(os.path.join("wnframework", "images", "user"))
    os.system("cp %s %s" % (os.path.join("erpnext", "module-icons.png"), os.path.join("wnframework", "images", "user")))
开发者ID:sudevkk,项目名称:erpnext-package-builder,代码行数:41,代码来源:install.py

示例6: restore_db

def restore_db():
	"""
		import the database
	"""
	sys.path.append(os.path.join('wnframework','cgi-bin'))

	import webnotes
	from webnotes.db import Database
	from webnotes.install_lib.install import Installer

	global db_name

	root_password = raw_input('Root password for mysql (for db and user creation):')

	inst = Installer('root', root_password)

	# gunzip
	os.system("gunzip -c %s > master.sql" % os.path.join('erpnext', 'master.sql.gz'))

	# import
	print "Importing database..."
	inst.import_from_db(db_name, 'master.sql')

	# cleanup
	webnotes.conn = Database('localhost','root',root_password)
	webnotes.conn.use(db_name)
	webnotes.conn.begin()
	webnotes.conn.set_value('Control Panel',None,'company_name',raw_input('[ERPNext setup] Enter the name of the full name of your company:'))
	webnotes.conn.sql("delete from tabSingles where field='sync_with_gateway'")
	webnotes.conn.commit()
	os.remove('master.sql')

	# copy icons
	if not os.path.exists(os.path.join('wnframework','images','user')):
		os.mkdir(os.path.join('wnframework','images','user'))
	os.system("cp %s %s" % (os.path.join('erpnext','module-icons.png'),os.path.join('wnframework','images','user')))
开发者ID:ranjithtenz,项目名称:erpnext-package-builder,代码行数:36,代码来源:install.py

示例7: export_doc

	elif options.reload_doc:
		webnotes.modules.patch_handler.reload_doc(\
			{"module":options.reload_doc[0], "dt":options.reload_doc[1], "dn":options.reload_doc[2]})		
		print '\n'.join(webnotes.modules.patch_handler.log_list)

	elif options.export_doc:
		from webnotes.modules import export_doc
		export_doc(options.export_doc[0], options.export_doc[1])

	# run all pending
	elif options.run_latest:
		apply_latest_patches()
	
	elif options.install:
		from webnotes.install_lib.install import Installer
		inst = Installer('root', options.root_password)
		inst.import_from_db(options.install[0], source_path=options.install[1],
			verbose = 1)

	elif options.install_fresh:
		from webnotes.install_lib.install import Installer
		inst = Installer('root', options.root_password)
		inst.import_from_db(options.install_fresh, verbose = 1)

	elif options.reinstall:
		from webnotes.install_lib.install import Installer
		inst = Installer('root', options.root_password)
		import conf
		inst.import_from_db(conf.db_name, verbose = 1)

	elif options.make_demo:
开发者ID:Yellowen,项目名称:wnframework,代码行数:31,代码来源:wnf.py

示例8: install

def install(db_name, source_sql=None, site=None, verbose=True, force=False, root_password=None, site_config=None, admin_password='admin'):
	from webnotes.install_lib.install import Installer
	inst = Installer('root', db_name=db_name, site=site, root_password=root_password, site_config=site_config)
	inst.install(db_name, source_sql=source_sql, verbose=verbose, force=force, admin_password=admin_password)
	webnotes.destroy()
开发者ID:Halfnhav,项目名称:wnframework,代码行数:5,代码来源:wnf.py

示例9: install

def install():
	print "Creating Fresh Database..."
	from webnotes.install_lib.install import Installer
	import conf
	inst = Installer('root')
	inst.import_from_db(conf.demo_db_name, verbose = 1)
开发者ID:CarlosAnt,项目名称:erpnext,代码行数:6,代码来源:make_demo.py

示例10: open

		os.path.join(erpnext_path, 'logs', 'error_log.txt'), content)
		
	
	# write conf file
	with open(os.path.join(erpnext_path, 'conf.py'), 'w') as new_conf:
		new_conf.write(content)	

# install db
import sys
sys.path.append(erpnext_path)
sys.path.append(os.path.join(erpnext_path, 'lib', 'py'))
import conf
sys.path.append(conf.modules_path)

from webnotes.install_lib.install import Installer
inst = Installer('root', root_pwd)
inst.import_from_db(new_dbname, source_path=os.path.join(erpnext_path, 'data', 'master.sql'), verbose = 1)

# apply patches
os.chdir(erpnext_path)
os.system("lib/wnf.py --update origin master")

# set filemode false
os.system("git config core.filemode false")
os.chdir(os.path.join(erpnext_path, 'lib'))
os.system("git config core.filemode false")

steps_remaining = """
Notes:
------
开发者ID:getsantanupathak,项目名称:erpnext,代码行数:30,代码来源:install_erpnext.py

示例11: run

def run():
	sys.path.append('.')
	sys.path.append('lib/py')
	import webnotes
	import conf
	sys.path.append(conf.modules_path)

	(options, args) = setup_options()


	from webnotes.db import Database
	import webnotes.modules.patch_handler

	# connect
	if options.db_name is not None:
		if options.password:
			webnotes.connect(options.db_name, options.password)
		else:
			webnotes.connect(options.db_name)
	elif not any([options.install, options.pull]):
		webnotes.connect(conf.db_name)

	# build
	if options.build:
		import build.project
		build.project.build()	

	# code replace
	elif options.replace:
		print options.replace
		replace_code('.', options.replace[0], options.replace[1], options.replace[2])
	
	# git
	elif options.status:
		os.system('git status')
		os.chdir('lib')
		os.system('git status')
	
	elif options.pull:
		pull(options.pull[0], options.pull[1])

	elif options.push:
		os.system('git commit -a -m "%s"' % options.push[2])
		os.system('git push %s %s' % (options.push[0], options.push[1]))
		os.chdir('lib')
		os.system('git commit -a -m "%s"' % options.push[2])
		os.system('git push %s %s' % (options.push[0], options.push[1]))
		
	elif options.checkout:
		os.system('git checkout %s' % options.checkout)
		os.chdir('lib')
		os.system('git checkout %s' % options.checkout)
			
	# patch
	elif options.patch_list:
		# clear log
		webnotes.modules.patch_handler.log_list = []
		
		# run individual patches
		for patch in options.patch_list:
			webnotes.modules.patch_handler.run_single(\
				patchmodule = patch, force = options.force)
		
		print '\n'.join(webnotes.modules.patch_handler.log_list)
	
		# reload
	elif options.reload_doc:
		webnotes.modules.patch_handler.reload_doc(\
			{"module":options.reload_doc[0], "dt":options.reload_doc[1], "dn":options.reload_doc[2]})		
		print '\n'.join(webnotes.modules.patch_handler.log_list)

	elif options.export_doc:
		from webnotes.modules import export_doc
		export_doc(options.export_doc[0], options.export_doc[1])

	# run all pending
	elif options.run_latest:
		apply_latest_patches()
	
	elif options.install:
		from webnotes.install_lib.install import Installer
		inst = Installer('root')
		inst.import_from_db(options.install[0], source_path=options.install[1], \
			password='admin', verbose = 1)
	
	elif options.diff_ref_file is not None:
		import webnotes.modules.diff
		webnotes.modules.diff.diff_ref_file()

	elif options.diff_ref_db is not None:
		import webnotes.modules.diff
		webnotes.modules.diff.diff_ref_db()
	
	elif options.run_scheduler:
		import webnotes.utils.scheduler
		print webnotes.utils.scheduler.execute()
	
	elif options.run_scheduler_event is not None:
		import webnotes.utils.scheduler
		print webnotes.utils.scheduler.trigger('execute_' + options.run_scheduler_event)
#.........这里部分代码省略.........
开发者ID:mehulsbhatt,项目名称:wnframework,代码行数:101,代码来源:wnf.py

示例12: run


#.........这里部分代码省略.........
	elif options.checkout:
		os.chdir('lib')
		os.system('git checkout %s' % options.checkout)
		os.chdir('../app')
		os.system('git checkout %s' % options.checkout)
			
	# patch
	elif options.patch_list:
		# clear log
		webnotes.modules.patch_handler.log_list = []
		
		# run individual patches
		for patch in options.patch_list:
			webnotes.modules.patch_handler.run_single(\
				patchmodule = patch, force = options.force)
		
		print '\n'.join(webnotes.modules.patch_handler.log_list)
	
		# reload
	elif options.reload_doc:
		webnotes.modules.patch_handler.reload_doc(\
			{"module":options.reload_doc[0], "dt":options.reload_doc[1], "dn":options.reload_doc[2]})		
		print '\n'.join(webnotes.modules.patch_handler.log_list)

	elif options.export_doc:
		from webnotes.modules import export_doc
		export_doc(options.export_doc[0], options.export_doc[1])

	# run all pending
	elif options.run_latest:
		apply_latest_patches()
	
	elif options.install:
		from webnotes.install_lib.install import Installer
		inst = Installer('root')
		inst.import_from_db(options.install[0], source_path=options.install[1],
			verbose = 1)

	elif options.install_fresh:
		from webnotes.install_lib.install import Installer
		inst = Installer('root')
		inst.import_from_db(options.install_fresh, verbose = 1)

	elif options.make_demo:
		import utilities.make_demo
		utilities.make_demo.make()

	elif options.make_demo_fresh:
		import utilities.make_demo
		utilities.make_demo.make(True)

	elif options.diff_ref_file is not None:
		import webnotes.modules.diff
		webnotes.modules.diff.diff_ref_file()

	elif options.diff_ref_db is not None:
		import webnotes.modules.diff
		webnotes.modules.diff.diff_ref_db()
	
	elif options.run_scheduler:
		import webnotes.utils.scheduler
		print webnotes.utils.scheduler.execute()
	
	elif options.run_scheduler_event is not None:
		import webnotes.utils.scheduler
		print webnotes.utils.scheduler.trigger('execute_' + options.run_scheduler_event)
开发者ID:akshayagarwal,项目名称:wnframework,代码行数:67,代码来源:wnf.py

示例13: run


#.........这里部分代码省略.........
        os.chdir("lib")
        os.system("git checkout %s" % options.checkout)
        os.chdir("../app")
        os.system("git checkout %s" % options.checkout)

        # patch
    elif options.patch_list:
        # clear log
        webnotes.modules.patch_handler.log_list = []

        # run individual patches
        for patch in options.patch_list:
            webnotes.modules.patch_handler.run_single(patchmodule=patch, force=options.force)

        print "\n".join(webnotes.modules.patch_handler.log_list)

        # reload
    elif options.reload_doc:
        webnotes.modules.patch_handler.reload_doc(
            {"module": options.reload_doc[0], "dt": options.reload_doc[1], "dn": options.reload_doc[2]}
        )
        print "\n".join(webnotes.modules.patch_handler.log_list)

    elif options.export_doc:
        from webnotes.modules import export_doc

        export_doc(options.export_doc[0], options.export_doc[1])

        # run all pending
    elif options.run_latest:
        apply_latest_patches()

    elif options.install:
        from webnotes.install_lib.install import Installer

        inst = Installer("root")
        inst.import_from_db(options.install[0], source_path=options.install[1], password="admin", verbose=1)

    elif options.diff_ref_file is not None:
        import webnotes.modules.diff

        webnotes.modules.diff.diff_ref_file()

    elif options.diff_ref_db is not None:
        import webnotes.modules.diff

        webnotes.modules.diff.diff_ref_db()

    elif options.run_scheduler:
        import webnotes.utils.scheduler

        print webnotes.utils.scheduler.execute()

    elif options.run_scheduler_event is not None:
        import webnotes.utils.scheduler

        print webnotes.utils.scheduler.trigger("execute_" + options.run_scheduler_event)

    elif options.sync_all is not None:
        sync_all(options.force or 0)

    elif options.sync is not None:
        import webnotes.model.sync

        webnotes.model.sync.sync(options.sync[0], options.sync[1], options.force or 0)
开发者ID:arunemmanuel,项目名称:wnframework,代码行数:66,代码来源:wnf.py

示例14: open

    # write conf file
    with open(os.path.join(erpnext_path, "conf.py"), "w") as new_conf:
        new_conf.write(content)

# install db
import sys

sys.path.append(erpnext_path)
sys.path.append(os.path.join(erpnext_path, "lib", "py"))
import conf

sys.path.append(conf.modules_path)

from webnotes.install_lib.install import Installer

inst = Installer("root", root_pwd)
inst.import_from_db(new_dbname, source_path=os.path.join(erpnext_path, "data", "master.sql"), verbose=1)

# apply patches
os.chdir(erpnext_path)
os.system("lib/wnf.py --update origin master")

# set filemode false
os.system("git config core.filemode false")
os.chdir(os.path.join(erpnext_path, "lib"))
os.system("git config core.filemode false")

steps_remaining = """
Notes:
------
开发者ID:smilekk,项目名称:erpnext,代码行数:30,代码来源:install_erpnext.py

示例15: run


#.........这里部分代码省略.........
	elif options.checkout:
		os.chdir('lib')
		os.system('git checkout %s' % options.checkout)
		os.chdir('../app')
		os.system('git checkout %s' % options.checkout)
			
	# patch
	elif options.patch_list:
		# clear log
		webnotes.modules.patch_handler.log_list = []
		
		# run individual patches
		for patch in options.patch_list:
			webnotes.modules.patch_handler.run_single(\
				patchmodule = patch, force = options.force)
		
		print '\n'.join(webnotes.modules.patch_handler.log_list)
	
		# reload
	elif options.reload_doc:
		webnotes.modules.patch_handler.reload_doc(\
			{"module":options.reload_doc[0], "dt":options.reload_doc[1], "dn":options.reload_doc[2]})		
		print '\n'.join(webnotes.modules.patch_handler.log_list)

	elif options.export_doc:
		from webnotes.modules import export_doc
		export_doc(options.export_doc[0], options.export_doc[1])

	# run all pending
	elif options.run_latest:
		apply_latest_patches()
	
	elif options.install:
		from webnotes.install_lib.install import Installer
		inst = Installer('root')
		inst.import_from_db(options.install[0], source_path=options.install[1],
			verbose = 1)

	elif options.install_fresh:
		from webnotes.install_lib.install import Installer
		inst = Installer('root')
		inst.import_from_db(options.install_fresh, source_path="lib/conf/Framework.sql",
			verbose = 1)

	elif options.diff_ref_file is not None:
		import webnotes.modules.diff
		webnotes.modules.diff.diff_ref_file()

	elif options.diff_ref_db is not None:
		import webnotes.modules.diff
		webnotes.modules.diff.diff_ref_db()
	
	elif options.run_scheduler:
		import webnotes.utils.scheduler
		print webnotes.utils.scheduler.execute()
	
	elif options.run_scheduler_event is not None:
		import webnotes.utils.scheduler
		print webnotes.utils.scheduler.trigger('execute_' + options.run_scheduler_event)
		
	elif options.sync_all is not None:
		sync_all(options.force or 0)

	elif options.sync is not None:
		import webnotes.model.sync
		webnotes.model.sync.sync(options.sync[0], options.sync[1], options.force or 0)
开发者ID:IPenuelas,项目名称:wnframework,代码行数:67,代码来源:wnf.py


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