本文整理汇总了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
示例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)
示例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)