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

Python setup_utils.getInput函数代码示例

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

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



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

示例1: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable Basic Publish?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES

    
    active = getInput("Maximum documents the node will accepts?", "1000", isInt)
    custom_opts["doc_limit"] = int(active)

    active = getInput("Enter message size limit in octet. \n"+
                    "This should the maximum data size the the node will accept", 4194304, isInt)

    custom_opts["msg_size_limit"] = int(active)

    custom_opts["authz"] = []
    active = getInput("Secure publish with Basic Authentication?", "T", isBoolean)
    if active:
        custom_opts["authz"].append("basicauth")

    active = getInput("Secure publish with OAuth and enable Node Signing?", "T", isBoolean)
    if active:
        custom_opts["authz"].append("oauth")
        setupInfo["oauth"] = True

    if len(custom_opts["authz"]) == 0:
        del custom_opts["authz"]

    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex
    
    return __BasicPublishServiceTemplate().install(server, dbname, custom_opts)
开发者ID:LearningRegistry,项目名称:LearningRegistry,代码行数:31,代码来源:Basic_Publish.py


示例2: getNGINXSiteConfig

def getNGINXSiteConfig(setupInfo, ini_config):
    import setup_utils, urlparse

    std_nginx_log = [
        "/var/log/nginx",
        "/usr/local/var/log"
    ]

    std_nginx_cfg = [
        "/etc/nginx",
        "/usr/local/etc/nginx"
    ]

    def_nginx_log = getFirstValidDefaultFromList(std_nginx_log, checkDirectoryExists)
    def_nginx_cfg = getFirstValidDefaultFromList(std_nginx_cfg, checkFileExists)

    context = {
        "id_management": setupInfo["oauth.app.name"],
        "couchapp_db": ini_config.get("app:main", "couchdb.db.apps"),
        "couchdb": ini_config.get("app:main","couchdb.url"),
        "uwsgi_app": ini_config.get("uwsgi", "socket"),
        "port_https": 443,
        "nginx_logs": def_nginx_log,
        "port_http": 80,
        "ssl_certificate": "%s/certs/server.crt" % def_nginx_cfg,
        "ssl_certificate_key": "%s/certs/server.key" % def_nginx_cfg
    }

    node_url = urlparse.urlsplit(setupInfo['nodeUrl'])
    if node_url.scheme == 'http':
        if node_url.port:
            context["port_http"] = node_url.port

        context["port_https"] = None
    elif node_url.scheme == 'https' and node_url.port:
        context["port_https"] = node_url.port
        context["port_http"] = node_url.port - 443 + 80

        context["port_http"] = setup_utils.getInput("Enter the HTTP (non-SSL) port number the node will operate", context["port_http"])
        context["ssl_certificate"] = setup_utils.getInput("Enter the absolute path to your SSL Certificate", context["ssl_certificate"], validateFunc=checkFileExists)
        context["ssl_certificate_key"] = setup_utils.getInput("Enter the absolute path to your SSL Certificate Key", context["ssl_certificate_key"], validateFunc=checkFileExists)

    context["nginx_logs"] = setup_utils.getInput("Enter the absolute path to the NGINX log directory", context["nginx_logs"])

    if context["port_https"]:
        return getSSLSiteConfig(context)
    else:
        return getSiteConfig(context)
开发者ID:LearningRegistry,项目名称:LearningRegistry,代码行数:48,代码来源:nginx_util.py


示例3: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable Slice?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES
    
    active = getInput("Enable Flow Control for Slice?", "T", isBoolean)
    custom_opts["flow_control"] = active.lower() in YES
    
    if custom_opts["flow_control"]:
        active = getInput("Maximum IDs to Return?", "100", isInt)
        custom_opts["id_limit"] = int(active)
        active = getInput("Maximum Docs to Return?", "100", isInt)
        custom_opts["doc_limit"] = int(active)

    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex

    return __SliceServiceTemplate().install(server, dbname, custom_opts)
开发者ID:ljwolford,项目名称:LearningRegistry,代码行数:18,代码来源:Slice.py


示例4: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable Resource Data Distribution?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES

    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex
    
    return __ResourceDataDistributionServiceTemplate().install(server, dbname, custom_opts)
开发者ID:LearningRegistry,项目名称:LearningRegistry,代码行数:9,代码来源:Resource_Data_Distribution.py


示例5: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable Network Node Status?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES
    
    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex

    return __NetworkNodeStatusServiceTemplate().install(server, dbname, custom_opts)
开发者ID:LearningRegistry,项目名称:LearningRegistry,代码行数:9,代码来源:Network_Node_Status.py


示例6: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable Basic Publish?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES

    
    active = getInput("Maximum documents the node will accepts?", "1000", isInt)
    custom_opts["doc_limit"] = int(active)

    active = getInput("Enter message size limit in octet. \n"+
                    "This should the maximum data size the the node will accept", None, isInt)

    custom_opts["msg_size_limit"] = int(active)

    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex
    
    return __BasicPublishServiceTemplate().install(server, dbname, custom_opts)
开发者ID:guywithnose,项目名称:LearningRegistry,代码行数:18,代码来源:Basic_Publish.py


示例7: prompt

def prompt():
    import setup_utils
    context = {}
    context.update(def_context)

    context["LR_BASE"] = setup_utils.getInput("Base Learning Registry Directory", context["LR_BASE"], checkDirectoryExists)

    possible = [
        "/var",
        "/usr/local/var"
    ]

    context["VAR_DIR"] = setup_utils.getInput("var directory", getFirstValidDefaultFromList(possible, checkDirectoryExists), checkDirectoryExists)


    context["LR_USER"] = setup_utils.getInput("Enter the user that LR process will run as", context["LR_USER"])
    context["LR_GRP"] = setup_utils.getInput("Enter the group that LR process will run as", context["LR_GRP"])

    return context
开发者ID:dbhurley,项目名称:LearningRegistry,代码行数:19,代码来源:service_util.py


示例8: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable Network Node Description?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES

    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex

    must = __NetworkNodeDescriptionServiceTemplate()
    config_doc = must.render(**custom_opts)
    print config_doc
    doc = json.loads(config_doc)
    PublishDoc(server, dbname, doc["service_type"] + ":Network Node Description service", doc)
    print ("Configured Network Node Description service:\n{0}\n".format(json.dumps(doc, indent=4, sort_keys=True)))
开发者ID:bhartigupta8,项目名称:LearningRegistry,代码行数:14,代码来源:Network_Node_Description.py


示例9: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable OAI-PMH Harvest?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES
    
    active = getInput("Enable OAI-PMH Flow Control?", "F", isBoolean)
    custom_opts["flow_control"] = active.lower() in YES
    
    if custom_opts["flow_control"]:
        active = getInput("Maximum IDs to Return?", "100", isInt)
        custom_opts["id_limit"] = int(active)
        active = getInput("Maximum Docs to Return?", "100", isInt)
        custom_opts["doc_limit"] = int(active)
        
        
    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex
    
    must = __OaiServiceTemplate()
    config_doc = must.render(**custom_opts)
    doc = json.loads(config_doc)
    PublishDoc(server, dbname, doc["service_type"]+":OAI-PMH service", doc)
    print("Configured OAI-PMH Harvest service:\n{0}\n".format(json.dumps(doc, indent=4, sort_keys=True)))
开发者ID:andreyfedoseev,项目名称:LearningRegistry,代码行数:23,代码来源:OAI-PMH_Harvest.py


示例10: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable SWORD Service?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES

    custom_opts["authz"] = []
    active = getInput("Secure publish with Basic Authentication?", "T", isBoolean)
    if active:
        custom_opts["authz"].append("basicauth")

    active = getInput("Secure publish with OAuth and enable Node Signing?", "T", isBoolean)
    if active:
        custom_opts["authz"].append("oauth")
        setupInfo["oauth"] = True

    if len(custom_opts["authz"]) == 0:
        del custom_opts["authz"]


    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex
    
    return __BasicSwordServiceTemplate().install(server, dbname, custom_opts)
开发者ID:LearningRegistry,项目名称:LearningRegistry,代码行数:23,代码来源:SWORD_APP_Publish_V1_3.py


示例11: install

def install(server, dbname, setupInfo):
    custom_opts = {}
    active = getInput("Enable Basic Publish?", "T", isBoolean)
    custom_opts["active"] = active.lower() in YES

    
    active = getInput("Maximum documents the node will accepts?", "1000", isInt)
    custom_opts["doc_limit"] = int(active)

    active = getInput("Enter message size limit in octet. \n"+
                    "This should the maximum data size the the node will accept", None, isInt)

    custom_opts["msg_size_limit"] = int(active)

    custom_opts["node_endpoint"] = setupInfo["nodeUrl"]
    custom_opts["service_id"] = uuid.uuid4().hex
    
    
    must = __BasicPublishServiceTemplate()
    config_doc = must.render(**custom_opts)
    print config_doc
    doc = json.loads(config_doc)
    PublishDoc(server, dbname,doc["service_type"]+":Basic Publish service", doc)
    print("Configured Basic Publish service:\n{0}\n".format(json.dumps(doc, indent=4, sort_keys=True)))
开发者ID:aworkman,项目名称:LearningRegistry,代码行数:24,代码来源:Basic_Publish.py


示例12: doesNotEndInSlash

            "service_key": "false", 
            "service_https": "false",
            "service_type": "access",
            "spec_kv_only": None,
            "flow_control": False,
            "id_limit": False,
            "doc_limit": False         
        }
        return opts
        
if __name__ == "__main__":
    import couchdb
    
    nodeSetup = {
                 'couchDBUrl': "http://localhost:5984",
                 'nodeUrl': "http://test.example.com"
    }
    
    def doesNotEndInSlash(input=None):
        return input is not None and input[-1] != "/"
    
    def notExample(input=None):
        return input is not None and input != nodeSetup["nodeUrl"]
    
    nodeSetup["couchDBUrl"] = getInput("Enter the CouchDB URL:", nodeSetup["couchDBUrl"], doesNotEndInSlash)
    nodeSetup["nodeUrl"] = getInput("Enter the public URL of the LR Node", nodeSetup["nodeUrl"], notExample)
    
    server =  couchdb.Server(url= nodeSetup['couchDBUrl'])
    install(server, "node", nodeSetup)
    
开发者ID:guywithnose,项目名称:LearningRegistry,代码行数:29,代码来源:Basic_Harvest.py


示例13: pushCouchApp

                appDir = os.path.join(appsPath, app)
                if os.path.isdir(appDir):
                    pushCouchApp(appDir, destURL)
                    
        




if __name__ == "__main__":
    from setup_utils import getInput
    
    logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
    
    def doesNotEndInSlash(input=None):
        return input is not None and input[-1] != "/"
    
    def dirExists(input=None):
        return input is not None and os.path.exists(input) and os.path.isdir(input)
    
    scriptPath = os.path.dirname(os.path.abspath(__file__))
    defaultPath = os.path.join(scriptPath, "..", "couchdb")
    
    couchDBUrl = getInput("Enter your couchDB server URL", "http://127.0.0.1:5984", doesNotEndInSlash)
        
    couchApps = getInput("Enter the base directory to the CouchApps", defaultPath, dirExists)
    
    pushAllCouchApps(couchApps, couchDBUrl)
    
    
    
开发者ID:andreyfedoseev,项目名称:LearningRegistry,代码行数:28,代码来源:couch_utils.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python setupbase.check_package_data_first函数代码示例发布时间:2022-05-27
下一篇:
Python setup_util.replace_text函数代码示例发布时间: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