Skip to content

Instantly share code, notes, and snippets.

@cdent
Forked from FND/simplewiki
Created December 3, 2009 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdent/248370 to your computer and use it in GitHub Desktop.
Save cdent/248370 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
"""
simplewiki instantiation
"""
import sys
from tiddlyweb.config import config
from tiddlywebplugins.instancer import Instance
def main(args):
args = [unicode(arg, "UTF-8") for arg in args]
instance_path = args[1]
store_structure = {
"bags": {
"wiki": {
"desc": "simplewiki contents",
"policy": {
"write": ["ANY"], # XXX: ?
"create": ["R:ADMIN"],
"delete": ["R:ADMIN"],
"manage": ["R:ADMIN"],
"accept": ["R:ADMIN"],
"owner": "administrator" # XXX: meaningless?
}
},
},
"recipes": {
"wiki": {
"desc": "simplewiki",
"recipe": [
("wiki", "")
],
"policy": {
"write": ["R:ADMIN"],
"create": ["R:ADMIN"],
"manage": ["R:ADMIN"],
"accept": ["R:ADMIN"],
"delete": ["R:ADMIN"],
"owner": "administrator" # XXX: meaningless?
}
}
}
}
config["instance_tiddlers"] = [
("wiki", ["FrontPage.tid"])
]
instance_config = {
"system_plugins": ["tiddlywebplugins.simplewiki"]
}
instance = Instance(instance_path, config, instance_config)
instance.spawn(store_structure)
instance.update_store()
return True
if __name__ == "__main__":
status = not main(sys.argv)
sys.exit(status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment