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


Python setup.setup函数代码示例

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


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


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