github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

tiddlyweb / tiddlyweb

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 14
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (2)
  • Downloads (1)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (15)
    • 1.0.x
    • bagdeque
    • bagtube
    • extractwiki
    • filterindex
    • filterindex2
    • filters2
    • genserializers
    • master ✓
    • prefixfiddle
    • revisions1
    • ssl_policy
    • tiddlergen
    • tmp-mgg
    • usertag
  • Tags (1)
    • v1.0.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

TiddlyWeb Core — Read more

  cancel

http://tiddlyweb.peermore.com/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Establish the branch management policy. Comment
Chris Dent (author)
Fri Jan 15 14:40:31 -0800 2010
commit  19f95be54aca42ed539e9fff3c090f981a419ab0
tree    70e93a7643718fd4fa341efd5ec12a0f66a8ba55
parent  01d869823c1731eee492306f0844c263f53ac704
tiddlyweb / profile / list_tiddlers.py profile/list_tiddlers.py
100644 89 lines (67 sloc) 2.033 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import sys
sys.path.insert(0, '.')
 
import shutil
 
from time import time
 
from tiddlyweb.config import config
 
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.tiddler import Tiddler
from tiddlyweb.store import Store
from tiddlyweb import control
from tiddlyweb.serializer import Serializer
from tiddlyweb.filters import parse_for_filters
 
environ = {}
environ['tiddlyweb.config'] = config
 
def run():
    clean_store()
    make_tiddlers_for_bag()
    profile_listing_tiddlers()
 
 
def clean_store():
    try:
        shutil.rmtree('store')
    except OSError:
        pass
 
def make_tiddlers_for_bag():
    store = Store('text', environ=environ)
 
    print 'store', time()
    bag = Bag('profiler')
    store.put(bag)
 
    for name in range(1, 10000):
        tag = name % 10
        name = str(name)
        tag = str(tag)
        tiddler = Tiddler(name, bag.name)
        tiddler.text = name
        tiddler.tags.append(tag)
        store.put(tiddler)
    print 'stored', time()
 
def profile_listing_tiddlers():
    store = Store('text', environ=environ)
    environ['tiddlyweb.store'] = store
 
    bag = Bag('profiler')
    bag.skinny = True
    store.get(bag)
 
    print 'filter', time()
    filter_string = 'select=tag:100'
    filters, leftovers = parse_for_filters(filter_string, environ)
    tiddlers = control.filter_tiddlers_from_bag(bag, filters)
 
    print 'tmp bag', time()
    tmp_bag = Bag('tmp_bag', tmpbag=True)
    tmp_bag.add_tiddlers(tiddlers)
 
    print 'output', time()
    print [tiddler.title for tiddler in control.get_tiddlers_from_bag(tmp_bag)]
 
    #print 'serializer', time()
    #serializer = Serializer('wiki', environ)
    #print 'wikify', time()
    #output = serializer.list_tiddlers(tmp_bag)
 
    print 'done', time()
 
 
if __name__ == '__main__':
    command = sys.argv[1]
    print command
    if command == 'clean':
        clean_store()
    elif command == 'make':
        make_tiddlers_for_bag()
    elif command == 'filter':
        profile_listing_tiddlers()
    else:
        run()
 
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server