-
-
Save cdent/248370 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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