Guest User

Untitled

a guest
May 16th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import sys
  2. import os
  3. # extend module search path for access to tiddlywebconfig.py
  4. sys.path.insert(0, os.getcwd())
  5.  
  6. from tiddlyweb.config import config
  7.  
  8. from tiddlywebplugins.instancer import Instance
  9.  
  10.  
  11. INSTANCE_PATH = "myInstance"
  12.  
  13. store_structure = {
  14. "bags": {
  15. "alpha": {},
  16. "bravo": {}
  17. },
  18. "recipes": {
  19. "default": {
  20. "recipe": [
  21. ("alpha", "select=tag:foo"),
  22. ("bravo", "limit=20")
  23. ]
  24. }
  25. }
  26. }
  27.  
  28. config["instance_tiddlers"] = [
  29. ("alpha", ["/path/to/foo.tid", "/path/to/bar.tiddler"]),
  30. ("bravo", ["/path/to/foo.recipe", "/path/to/bar.js"])
  31. ]
  32.  
  33. config["instance_config_head"] = "\n# lorem ipsum dolor sit amet\n"
  34.  
  35. instance = Instance(INSTANCE_PATH, config)
  36. instance.spawn(store_structure)
Add Comment
Please, Sign In to add comment