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


Python cherrypy.process方法代码示例

本文整理汇总了Python中cherrypy.process方法的典型用法代码示例。如果您正苦于以下问题:Python cherrypy.process方法的具体用法?Python cherrypy.process怎么用?Python cherrypy.process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cherrypy的用法示例。


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

示例1: run

# 需要导入模块: import cherrypy [as 别名]
# 或者: from cherrypy import process [as 别名]
def run():
    """Run cherryd CLI."""
    from optparse import OptionParser

    p = OptionParser()
    p.add_option('-c', '--config', action='append', dest='config',
                 help='specify config file(s)')
    p.add_option('-d', action='store_true', dest='daemonize',
                 help='run the server as a daemon')
    p.add_option('-e', '--environment', dest='environment', default=None,
                 help='apply the given config environment')
    p.add_option('-f', action='store_true', dest='fastcgi',
                 help='start a fastcgi server instead of the default HTTP '
                      'server')
    p.add_option('-s', action='store_true', dest='scgi',
                 help='start a scgi server instead of the default HTTP server')
    p.add_option('-x', action='store_true', dest='cgi',
                 help='start a cgi server instead of the default HTTP server')
    p.add_option('-i', '--import', action='append', dest='imports',
                 help='specify modules to import')
    p.add_option('-p', '--pidfile', dest='pidfile', default=None,
                 help='store the process id in the given file')
    p.add_option('-P', '--Path', action='append', dest='Path',
                 help='add the given paths to sys.path')
    options, args = p.parse_args()

    if options.Path:
        for p in options.Path:
            sys.path.insert(0, p)

    start(options.config, options.daemonize,
          options.environment, options.fastcgi, options.scgi,
          options.pidfile, options.imports, options.cgi) 
开发者ID:cherrypy,项目名称:cherrypy,代码行数:35,代码来源:daemon.py

示例2: main

# 需要导入模块: import cherrypy [as 别名]
# 或者: from cherrypy import process [as 别名]
def main():
    from optparse import OptionParser

    p = OptionParser()
    p.add_option('-c', '--config', dest='config',
                 help="specify config file")
    p.add_option('-d', action="store_true", dest='daemonize',
                 help="run the server as a daemon")
    p.add_option('-e', '--environment', dest='environment', default=None,
                 help="apply the given config environment")
    p.add_option('-f', action="store_true", dest='fastcgi',
                 help="start a fastcgi server instead"
                 " of the default HTTP server")
    p.add_option('-s', action="store_true", dest='scgi',
                 help="start a scgi server instead of the default HTTP server")
    p.add_option('-x', action="store_true", dest='cgi',
                 help="start a cgi server instead of the default HTTP server")
    p.add_option('-p', '--pidfile', dest='pidfile', default=None,
                 help="store the process id in the given file")
    p.add_option('-P', '--Path', action="append", dest='Path',
                 help="add the given paths to sys.path")
    p.add_option('-D', '--debug', action="store_true", dest='debug',
                 help="debug to stderr in foreground")
    options, args = p.parse_args()

    if options.Path:
        for p in options.Path:
            sys.path.insert(0, p)

    if options.config is None:
        print('-c|--config <path/to/config/file> is mandatory')
        exit(1)

    if not os.path.isfile(options.config):
        print('configuration file "' + options.config + '" doesn\'t exist')
        exit(1)

    start(options.config, options.daemonize,
          options.environment, options.fastcgi, options.scgi,
          options.pidfile, options.cgi, options.debug) 
开发者ID:kakwa,项目名称:ldapcherry,代码行数:42,代码来源:cli.py

示例3: run

# 需要导入模块: import cherrypy [as 别名]
# 或者: from cherrypy import process [as 别名]
def run():
    from optparse import OptionParser

    p = OptionParser()
    p.add_option('-c', '--config', action='append', dest='config',
                 help='specify config file(s)')
    p.add_option('-d', action='store_true', dest='daemonize',
                 help='run the server as a daemon')
    p.add_option('-e', '--environment', dest='environment', default=None,
                 help='apply the given config environment')
    p.add_option('-f', action='store_true', dest='fastcgi',
                 help='start a fastcgi server instead of the default HTTP '
                      'server')
    p.add_option('-s', action='store_true', dest='scgi',
                 help='start a scgi server instead of the default HTTP server')
    p.add_option('-x', action='store_true', dest='cgi',
                 help='start a cgi server instead of the default HTTP server')
    p.add_option('-i', '--import', action='append', dest='imports',
                 help='specify modules to import')
    p.add_option('-p', '--pidfile', dest='pidfile', default=None,
                 help='store the process id in the given file')
    p.add_option('-P', '--Path', action='append', dest='Path',
                 help='add the given paths to sys.path')
    options, args = p.parse_args()

    if options.Path:
        for p in options.Path:
            sys.path.insert(0, p)

    start(options.config, options.daemonize,
          options.environment, options.fastcgi, options.scgi,
          options.pidfile, options.imports, options.cgi) 
开发者ID:morpheus65535,项目名称:bazarr,代码行数:34,代码来源:daemon.py


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