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


Python Space.create_space方法代码示例

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


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

示例1: post_space_handler

# 需要导入模块: from space import Space [as 别名]
# 或者: from space.Space import create_space [as 别名]
def post_space_handler(environ, start_response):
    """
    entry point for posting a new space name to TiddlyWeb
    """
    space_name = environ['tiddlyweb.query']['name'][0]

    space = Space(environ)

    try:
        space.create_space(space_name, environ['tiddlyweb.config']['space'])
    except (RecipeExistsError, BagExistsError):
        raise HTTP409('Space already Exists: %s' % space_name)

    host = environ['tiddlyweb.config']['server_host']
    if 'port' in host:
        port = ':%s' % host['port']
    else:
        port = ''

    recipe = Recipe('%s_public' % space_name)
    new_space_uri = '%s/tiddlers.wiki' % recipe_url(environ, recipe)

    start_response('201 Created', [
        ('Location', new_space_uri),
        ('Content-type', 'text/plain')])
    return new_space_uri
开发者ID:FND,项目名称:tiddlyspace.old,代码行数:28,代码来源:handler.py

示例2: create_room_elements

# 需要导入模块: from space import Space [as 别名]
# 或者: from space.Space import create_space [as 别名]
def create_room_elements(room_name):
    room_space = Space({'tiddlyweb.store': store})
    
    this_room = ROOM.replace('ROOMNAME', room_name)
    
    this_room = json.loads(this_room)
    
    room_space.create_space(this_room)
开发者ID:FND,项目名称:tiddlywiki-svn-mirror,代码行数:10,代码来源:room_script.py

示例3: addproject

# 需要导入模块: from space import Space [as 别名]
# 或者: from space.Space import create_space [as 别名]
def addproject(args):
    """make a project space. <project_name>"""
    if len(args) != 1:
        print >> sys.stderr, ('usage: twanager addproject <project_name>')
    
    #replace PROJECT_NAME with the actual name of the project
    this_project = PROJECT.replace('PROJECT_NAME', args[0])
    this_project = json.loads(this_project)
    
    #create the space
    project_space = Space({'tiddlyweb.store': get_store(config)})
    project_space.create_space(this_project)
开发者ID:bengillies,项目名称:TiddlyWeb-Plugins,代码行数:14,代码来源:project_space.py


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