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

Python setup.setup函数代码示例

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

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



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

示例1: run

    def run(self):
        import setup

        _old_argv = _sys.argv
        try:
            _sys.argv = ["setup.py", "-q", "build"]
            if not self.HIDDEN:
                _sys.argv.remove("-q")
            setup.setup()
            if "java" not in _sys.platform.lower():
                _sys.argv = [
                    "setup.py",
                    "-q",
                    "install_lib",
                    "--install-dir",
                    shell.native(self.dirs["lib"]),
                    "--optimize",
                    "2",
                ]
                if not self.HIDDEN:
                    _sys.argv.remove("-q")
                setup.setup()
        finally:
            _sys.argv = _old_argv

        for name in shell.files("%s/tdi" % self.dirs["lib"], "*.py"):
            self.compile(name)
        term.write("%(ERASE)s")

        term.green("All files successfully compiled.")
开发者ID:ndparker,项目名称:tdi,代码行数:30,代码来源:make.py


示例2: commandstart

def commandstart():
    print(coinlist[0])
    setup(appdirpath, appdatfile, appdatadirpath, appdata, snpy, coinlist, exenames)
    coincontroller = Coincontroller(coinlist, rpcports)
    startcoinservers(coincontroller, exenames, envars, startupstatcheckfreqscnds, appdata)
    conn = coincontroller
    paramslist['getsynctime'] = conn
    
        
    
    # appfilemakeifno()
    
    while True:
        uinput = str(input('$$')).split()
        if len(uinput) > 0:
            if uinput[0].lower() in listcommands:
                if len(uinput) > 1:
                    if uinput[0].lower() in paramslist:
                        globals()[str('command' + uinput[0].lower())](paramslist[uinput[0]](uinput[1].lower()))
                        #globals()[str('command' + uinput[0].lower())](uinput[1].lower())
                    else:
                        print('\"' + uinput[1] + '\"' + ', is not a valid parameter. Type help for a list of available commands and parameters wrapped with bracket example: getsynctime [coin] is typed:/ngetsynctime turbostake')
                        
                else:
                    globals()[str('command' + uinput[0].lower())]()               
            
            else:
                print('\"' + uinput[0] + '\"' + ', is not a valid command. Type help for a list of available commands.')
        else:
            print('invalid command. Type help for a list of available commands.')
开发者ID:Triballian,项目名称:stakenannyb,代码行数:30,代码来源:stakenannyb.py


示例3: exec_command

def exec_command(cluster, run, command, **kwargs):
    log.info('exec_command: {0}'.format(command))
    action = command.split(' ', 1)
    result = 0
    if action[0] == 'sh':
        result = cmd(action[1])[0]
    elif action[0] == 'create':
        env.is_local = True
        env.host = 'localhost'
        container.create(cluster[action[1]])
        env.is_local = False
    elif action[0] == 'delete':
        env.is_local = True
        env.host = 'localhost'
        container.delete(cluster[action[1]])
        env.is_local = False
    elif action[0] == 'setup':
        env.runs = [run]
        env.user = CONF.job_user
        env.password = CONF.job_password
        CONF.user = CONF.job_user
        CONF.password = CONF.job_password
        setup(**kwargs)
    elif action[0] == 'manage':
        env.runs = [run]
        env.user = CONF.job_user
        env.password = CONF.job_password
        CONF.user = CONF.job_user
        CONF.password = CONF.job_password
        manage(action[1], **kwargs)

    log.info('result_command: {0}({1})'.format(command, result))
    return result
开发者ID:fabrickit,项目名称:fabkit,代码行数:33,代码来源:base.py


示例4: __init__

    def __init__(self):
        logutils.setup_logging("mustikkabot")
        self.log = logging.getLogger("mustikkabot")

        self.basepath = tools.find_basepath()
        self.confdir = os.path.join(self.basepath, "config")
        self.datadir = os.path.join(self.basepath, "data")
        self.srcdir = os.path.join(self.basepath, "src")

        setup.setup(self)
        setup.do_migrations(self)

        self.ircsock = None
        self.lastReceived = None

        self.user = None
        self.channel = None

        self.eventmanager = EventManager()
        """ :type: EventManager"""
        self.modulemanager = ModuleManager()
        """ :type: ModuleManager"""
        self.accessmanager = AccessManager()
        """ :type: AccessManager"""
        self.timemanager = TimeManager()
        """ :type: TimeManager"""

        self.run = True
开发者ID:RetzKu,项目名称:mustikkaBot,代码行数:28,代码来源:main.py


示例5: run

    def run(self):
        import setup

        _old_argv = _sys.argv
        try:
            _sys.argv = ['setup.py', '-q', 'build']
            if not self.HIDDEN:
                _sys.argv.remove('-q')
            setup.setup()
            if 'java' not in _sys.platform.lower():
                _sys.argv = [
                    'setup.py', '-q', 'install_lib', '--install-dir',
                    shell.native(self.dirs['lib']),
                    '--optimize', '2',
                ]
                if not self.HIDDEN:
                    _sys.argv.remove('-q')
                setup.setup()
        finally:
            _sys.argv = _old_argv

        for name in shell.files("%s/wtf" % self.dirs['lib'], '*.py'):
            self.compile(name)
        term.write("%(ERASE)s")

        term.green("All files successfully compiled.")
开发者ID:ndparker,项目名称:wtf,代码行数:26,代码来源:make.py


示例6: test2

def test2():
    "with index on 'country'"
    cleanup(get_postgres_connection())
    setup(get_postgres_connection())
    run_queries(get_postgres_connection(), index_queries_gin)
    get_mongo_client().test.test.ensure_index("country")
    results = [0.0, 0.0, 0.0, 0.0]
    test_base(1000, results)
    print "test 2 - insert with GIN (+mongo index): ", results
开发者ID:jsenko,项目名称:mongo-postgres-json-test,代码行数:9,代码来源:insert.py


示例7: check_setup

def check_setup():
    try:
        imp.find_module('dhtreader')
        found = True
    except ImportError:
        found = False

    if found is False:
        import setup
        setup.setup()
开发者ID:h4llow3En,项目名称:Thermometer,代码行数:10,代码来源:main.py


示例8: resetPrpr

def resetPrpr():
    """
    Removes all files from working directories, invokes prpr setup.
    """
    os.remove('prpr.db')
    dirs = ['esc', 'incoming', 'logs', 'tables']
    for dir in dirs:
        files = os.listdir(dir)
        for file in files:
            os.remove(dir + os.sep + file)
    import setup
    setup.setup()
开发者ID:JBEI,项目名称:prpr,代码行数:12,代码来源:reset.py


示例9: setUp

    def setUp(self):
        web_ca.app.config['TESTING'] = True
        web_ca.app.config['WTF_CSRF_ENABLED'] = False

        self.workdir = tempfile.mkdtemp()
        setup.setup(self.workdir)
        web_ca.app.config['WEB_CA_WORK_DIR'] = self.workdir

        shutil.copy('test/ca.crt', self.workdir)
        shutil.copy('test/ca.key', self.workdir)

        self.app = web_ca.app.test_client()
开发者ID:ulich,项目名称:web-ca,代码行数:12,代码来源:web_ca_test.py


示例10: execute

 def execute(self, context):
     # <self.logger> may be set in <setup(..)>
     self.logger = None
     # defines for which layerId's material is set per item instead of per layer
     self.materialPerItem = set()
     
     scene = context.scene
     kwargs = {}
     
     # setting active object if there is no active object
     if context.mode != "OBJECT":
         # if there is no object in the scene, only "OBJECT" mode is provided
         if not context.scene.objects.active:
             context.scene.objects.active = context.scene.objects[0]
         bpy.ops.object.mode_set(mode="OBJECT")
         
     if not self.app.has(Keys.mode3d):
         self.mode = '2D'
     
     # manager (derived from manager.Manager) performing some processing
     self.managers = []
     
     self.prepareLayers()
     if not len(self.layerIndices):
         self.layered = False
     
     osm = Osm(self)
     setup(self, osm)
     
     if "lat" in scene and "lon" in scene and not self.ignoreGeoreferencing:
         kwargs["projection"] = TransverseMercator(lat=scene["lat"], lon=scene["lon"])
     else:
         kwargs["projectionClass"] = TransverseMercator
     
     osm.parse(**kwargs)
     self.process()
     self.render()
     
     # setting 'lon' and 'lat' attributes for <scene> if necessary
     if not "projection" in kwargs:
         # <kwargs["lat"]> and <kwargs["lon"]> have been set in osm.parse(..)
         scene["lat"] = osm.lat
         scene["lon"] = osm.lon
     
     if not self.app.has(Keys.mode3d):
         self.app.show()
     
     return {"FINISHED"}
开发者ID:sambler,项目名称:myblendercontrib,代码行数:48,代码来源:__init__.py


示例11: main

def main():  
    parser = argparse.ArgumentParser()
    parser.add_argument('command_name')
    parser.add_argument('command_args', nargs='*')
    args = parser.parse_args()

    command_name = args.command_name
    command_args = args.command_args

    if command_name == "setup":
        generate_bulbsconf()
        return setup(command_args)

    if command_name == "bulbsconf":
        return generate_bulbsconf()

    config = Config()
    
    # try to import graph from the local bulbsconf if it exists
    path = config.working_dir
    sys.path.insert(0, path)
    from bulbsconf import graph

    command = Command(config, graph)
    command._execute(command_name, command_args)
开发者ID:abhishektayal,项目名称:lightbulb,代码行数:25,代码来源:command.py


示例12: __init__

    def __init__(self):
        conn = pymongo.Connection("localhost", 27017)  # This creates a connection to local pymongo
        self.db = conn["blog"]
        if not self.db.posts.find_one({"title": "root"}):  # If the blog is new installed root should not exist
            setup.setup(conn["blog"])                      # and so it will be created
        handlers = routes

        sidebar = get_archive_and_categories(self.db)       # generate the data for sidebar
        static_pages_list = get_static_pages_list(self.db)  # and the static pages on navigation bar

        page_data["sidebar"] = sidebar                      # then fill the page_data
        page_data["static_pages_list"] = static_pages_list  # It's expected that page_data will not change very often
        page_data["blog_title"] = conf.blog_title           # Man! less database calls!

        settings = dict(template_path=os.path.join(os.path.dirname(__file__), "templates"),
                        static_path=os.path.join(os.path.dirname(__file__), "static"),
                        debug=conf.debug,)
        tornado.web.Application.__init__(self, handlers, **settings)
开发者ID:leonardodaniel,项目名称:Ipython-blog,代码行数:18,代码来源:server.py


示例13: setup

def setup(cmdline):
    survey = model.survey.Survey.new(cmdline['project'])

    # Cleanup of options.
    if cmdline['global_id'] == '':
        cmdline['global_id'] = None

    import setup
    return setup.setup(survey, cmdline)
开发者ID:alfonsodg,项目名称:sdaps,代码行数:9,代码来源:__init__.py


示例14: app_factory

def app_factory(**local_conf):
    settings = setup.setup(**local_conf)
    app = App(settings)
    app = werkzeug.wsgi.SharedDataMiddleware(app, {
        '/css': os.path.join(settings.static_file_path, 'css'),
        '/js': os.path.join(settings.static_file_path, 'js'),
        '/img': os.path.join(settings.static_file_path, 'img'),
    })
    return app
开发者ID:mrtopf,项目名称:quantumblog,代码行数:9,代码来源:main.py


示例15: main

def main():
# Main loop brings all of the functionality together
	print "Initializing..."
	if SETUP == True:
		setup.setup()
	time.sleep(5)
	loopCount = 0
	while True:
		setup.scan()
		data = readData()
		display(data)
		loopCount = loopCount +1
		if loopCount >= loopLimit:
			if shutdown == True:
				followers.shutdownDisplay()
				print "SHUT DOWN!"
				os.system("sudo shutdown -h now")
			else:
				loopCount = 0
开发者ID:DaxMoonJuice,项目名称:pangolin_pad,代码行数:19,代码来源:main.py


示例16: prepareSourceTree

def prepareSourceTree(srcdir, customerRelease=False):
  if not customerRelease:
    # import setup.py from src/build_system
    buildsystemdir = os.path.join(srcdir, "build_system")
    if sys.path[0] != buildsystemdir:
      if buildsystemdir in sys.path:
        sys.path.remove(buildsystemdir)
      sys.path.insert(0, buildsystemdir)
    import setup
    setup.setup(srcdir)
    
  # Run autogen.sh
  if sys.platform != "win32":
    origDir = os.getcwd()
    # autogen.sh in the source dir
    try:
      utils.changeDir(srcdir)
      utils.runCommand('sh build_system/unix/autogen.sh')
    finally:
      utils.changeDir(origDir)
开发者ID:JimAllanson,项目名称:nupic,代码行数:20,代码来源:build.py


示例17: initUI

    def initUI(self):      
        self.setGeometry(500, 300, 800, 600)
        self.setWindowTitle('varDB GUI')

        #Create option buttons
        addButton=QtGui.QPushButton("Add Variable")
        addButton.pressed.connect(lambda: newSig(self))
        self.saveButton=QtGui.QPushButton("Save Changes")
        self.deleteButton=QtGui.QPushButton("Delete Selected variable")
        quitButton=QtGui.QPushButton("Quit")
        quitButton.clicked.connect(QtCore.QCoreApplication.instance().quit)

        #Creates left and right sections, search bar, scroll area
        hbox = QtGui.QHBoxLayout(self)
        self.left = QtGui.QFrame(self)
        self.upright = QtGui.QFrame(self)
        self.downright = QtGui.QFrame(self)
        self=setup(hbox,self,"VDB.xml")
        self.searchText.textEdited.connect(lambda: generateButtons(self,str(self.searchText.text()),0))
        self.setLayout(hbox)

        #Populates scroll area
        generateButtons(self,'',-1)

        #Option buttons layout
        hlox=QtGui.QHBoxLayout()
        hlox2=QtGui.QHBoxLayout()
        hlox.addStretch(1)
        hlox.addWidget(addButton,1)
        hlox.addWidget(self.saveButton,1)
        hlox.addWidget(self.deleteButton,1)
        hlox.addWidget(quitButton,1)
        hlox.addStretch()
        vbox=QtGui.QVBoxLayout()
        vbox.addStretch(1)
 	vbox.addLayout(hlox)
 	vbox.addLayout(hlox2)
        self.downright.setLayout(vbox)
开发者ID:Propelsion,项目名称:Portfolio,代码行数:38,代码来源:VDB.py


示例18: Copyright

# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4

# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Public License version 2.1 as published by
# the Free Software Foundation.
# This file is distributed without any warranty; without even the implied
# warranty of merchantability or fitness for a particular purpose.
# See "LICENSE.LGPL" in the source distribution for more information.
#
# Headers in this file shall remain intact.


from twisted.internet import reactor

import setup
setup.setup()

#from flumotion.common import log
#log.logTwisted()
开发者ID:flumotion-mirror,项目名称:flumotion-dvb,代码行数:25,代码来源:common.py


示例19: setup_tex

def setup_tex(cmdline):
    survey = model.survey.Survey.new(cmdline['project'])
    import setup
    return setup.setup(survey, cmdline)
开发者ID:gabisurita,项目名称:GDAd,代码行数:4,代码来源:__init__.py


示例20: setUp

 def setUp(self):
     self.set = setup()
开发者ID:kayapo,项目名称:logWalker,代码行数:2,代码来源:logwalkertest.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python setup_util.get_fwroot函数代码示例发布时间:2022-05-27
下一篇:
Python setup.require_git_master函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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