Exemplo n.º 1
0
def test_field_composed_filter():
    """
    Add a field to a tiddler and then make sure we can filter for it.
    """

    tiddler1 = Tiddler('one')
    tiddler1.fields = {'status': 'hot'}
    tiddler2 = Tiddler('two')
    tiddler2.fields = {'status': 'cold'}
    tiddler3 = Tiddler('three')

    filter_string = '[status[hot]]'
    filters = filter.compose_from_string(filter_string)
    found_tiddlers = filter.by_composition(filters, [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['one']

    filter_string = '[!status[hot]]'
    filters = filter.compose_from_string(filter_string)
    found_tiddlers = filter.by_composition(filters, [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['two', 'three']

    filter_string = '[status[cold]]'
    filters = filter.compose_from_string(filter_string)
    found_tiddlers = filter.by_composition(filters, [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['two']

    filter_string = '[barnabas[monkey]]'
    filters = filter.compose_from_string(filter_string)
    found_tiddlers = filter.by_composition(filters, [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == []

    filter_string = '[!barnabas[monkey]]'
    filters = filter.compose_from_string(filter_string)
    found_tiddlers = filter.by_composition(filters, [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['one', 'two', 'three']
Exemplo n.º 2
0
def test_field_composed_filter():
    """
    Add a field to a tiddler and then make sure we can filter for it.
    """

    tiddler1 = Tiddler('one')
    tiddler1.fields = {'status': 'hot'}
    tiddler2 = Tiddler('two')
    tiddler2.fields = {'status': 'cold'}
    tiddler3 = Tiddler('three')

    found_tiddlers = filter('select=status:hot', [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['one']

    found_tiddlers = filter('select=status:!hot', [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['two', 'three']

    found_tiddlers = filter('select=status:cold', [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['two']

    found_tiddlers = filter('select=barnabas:monkey', [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == []

    found_tiddlers = filter('select=barnabas:!monkey', [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['one', 'two', 'three']
Exemplo n.º 3
0
def test_field_composed_filter():
    """
    Add a field to a tiddler and then make sure we can filter for it.
    """
    tiddler1 = Tiddler('one')
    tiddler1.fields = {'status': 'hot'}
    tiddler2 = Tiddler('two')
    tiddler2.fields = {'status': 'cold'}
    tiddler3 = Tiddler('three')

    found_tiddlers = filter('select=status:hot',
                            [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['one']

    found_tiddlers = filter('select=status:!hot',
                            [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['two', 'three']

    found_tiddlers = filter('select=status:cold',
                            [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == ['two']

    found_tiddlers = filter('select=barnabas:monkey',
                            [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title for tiddler in found_tiddlers] == []

    found_tiddlers = filter('select=barnabas:!monkey',
                            [tiddler1, tiddler2, tiddler3])
    assert [tiddler.title
            for tiddler in found_tiddlers] == ['one', 'two', 'three']
Exemplo n.º 4
0
def setup_testdata():
  testdata = [
    {"title":u"Whiskers","tags":["I wRiTe lIke A fIvE yEaR oLd","Kitty","pet","lolcat"],"fields":{"read":"no","badfield":"z"}},
    {"title":u"Fred","tags":["dog","pet"],"fields":{"badfield":"xt"}},
    {"title":u"Chris","tags":["cat","animal","bogof"],"fields":{"badfield":"ks"}},
    {"title":u"Martin","tags":["fish","lion"],"fields":{"badfield":"zs"}},
    {"title":u"Jerm","tags":["monkey"],"fields":{"badfield":"z"}},
    {"title":u"Paul","tags":["dinosaurs rule","tiger"],"fields":{"badfield":"z"}},
    {"title":u"Ben","tags":["cAt","i love my cat"],"fields":{"badfield":"z"}},
    {"title":u"Andrew","tags":["Pet","Animal","kitty","ToysRUs"],"fields":{"badfield":"z","foo":"yes"}}
  
  ]
  tiddlers = []
  for tid in testdata:
    tiddler = Tiddler(tid["title"],"tmp")
    tiddler.fields = tid["fields"]
    tiddler.tags = tid["tags"]
    tiddlers.append(tiddler)

  
  bag = Bag("tmp")
  try:
    store.delete(bag)#delete any existing one
  except NoBagError:
    pass
    
  store.put(bag)
  for tiddler in tiddlers:
    store.put(tiddler)
Exemplo n.º 5
0
def handler(environ, start_response):
    input = environ['tiddlyweb.query']
    store = environ['tiddlyweb.store']

    # deal with python cgi packaging
    for field in input:
        if field in SKIP_FIELDS:
            continue
        input[field] = input[field][0]

    # need this to come in on the form input
    tiddler_title = input['tiddler_title']
    del input['tiddler_title']

    tiddler = Tiddler(tiddler_title, TARGET_BAG) # XXX is this the bag you want?
    try:
        tiddler.text = input['text']
        del input['text']
    except KeyError:
        tiddler.text = ''
    tiddler.fields = input

    store.put(tiddler)

    url = '/' # XXX replace with real url
    raise HTTP302(url)
def test_cascade():
    bag = Bag(u'holder')
    store.put(bag)
    tiddler = Tiddler(u'one', u'holder')
    tiddler.text = u'text'
    tiddler.tags = [u'tag']
    tiddler.fields = {u'fieldone': u'valueone'}
    store.put(tiddler)

    def count_em(count, message):
        text_count = store.storage.session.query(sText).count()
        tag_count = store.storage.session.query(sTag).count()
        tiddler_count = store.storage.session.query(sTiddler).count()
        revision_count = store.storage.session.query(sRevision).count()
        field_count = store.storage.session.query(sField).count()
        store.storage.session.commit()

        message = ('%s, but got: text: %s, tag: %s, tiddler: %s, '
            'revision: %s, field: %s') % (message, text_count, tag_count,
                    tiddler_count, revision_count, field_count)

        assert (text_count == tag_count == tiddler_count
                == revision_count == field_count == count), message

    count_em(1, '1 row for the tiddler everywhere')

    store.delete(tiddler)

    count_em(0, '0 rows for the tiddler everywhere')
Exemplo n.º 7
0
def test_cascade():
    bag = Bag(u'holder')
    store.put(bag)
    tiddler = Tiddler(u'one', u'holder')
    tiddler.text = u'text'
    tiddler.tags = [u'tag']
    tiddler.fields = {u'fieldone': u'valueone'}
    store.put(tiddler)

    def count_em(count, message):
        text_count = store.storage.session.query(sText).count()
        tag_count = store.storage.session.query(sTag).count()
        tiddler_count = store.storage.session.query(sTiddler).count()
        revision_count = store.storage.session.query(sRevision).count()
        field_count = store.storage.session.query(sField).count()
        store.storage.session.commit()

        message = ('%s, but got: text: %s, tag: %s, tiddler: %s, '
                   'revision: %s, field: %s') % (message, text_count,
                                                 tag_count, tiddler_count,
                                                 revision_count, field_count)

        assert (text_count == tag_count == tiddler_count == revision_count ==
                field_count == count), message

    count_em(1, '1 row for the tiddler everywhere')

    store.delete(tiddler)

    count_em(0, '0 rows for the tiddler everywhere')
Exemplo n.º 8
0
def test_tiddler_fields_are_stored():
    bag = Bag('bag0')
    store.put(bag)
    tiddler = Tiddler('feebles', bag='bag0')
    tiddler.fields = {'field1': 'value1', 'field2': 'value2'}
    store.put(tiddler)

    tiddler_second = Tiddler('feebles', bag='bag0')
    tiddler_second = store.get(tiddler_second)
    assert tiddler_second.fields['field1'] == 'value1'
    assert tiddler_second.fields['field2'] == 'value2'
Exemplo n.º 9
0
def test_tiddler_fields_are_stored():
    bag = Bag('bag0')
    store.put(bag)
    tiddler = Tiddler('feebles', bag='bag0')
    tiddler.fields = {u'field1': u'value1', u'field2': u'value2'}
    store.put(tiddler)

    tiddler_second = Tiddler('feebles', bag='bag0')
    tiddler_second = store.get(tiddler_second)
    assert tiddler_second.fields['field1'] == 'value1'
    assert tiddler_second.fields['field2'] == 'value2'
Exemplo n.º 10
0
def test_unicode_field_keys():
    tiddler = Tiddler('two', 'abag')
    tiddler.text = 'hi'
    tiddler.fields = {u'h\u8976': 'two'}

    assert tiddler.fields[u'h\u8976'] == 'two'

    store.put(tiddler)

    tiddler = store.get(Tiddler('two', 'abag'))
    assert tiddler.fields[u'h\u8976'] == 'two'
Exemplo n.º 11
0
def test_title_fields():
    store.put(Bag('abag'))

    tiddler = Tiddler('one', 'abag')
    tiddler.text = 'hi'
    tiddler.fields = {'title': 'two'}

    assert tiddler.title == 'one'
    assert tiddler.fields['title'] == 'two'

    pytest.raises(TiddlerFormatError, 'store.put(tiddler)')
Exemplo n.º 12
0
def test_unicode_field_keys():
    tiddler = Tiddler('two', 'abag')
    tiddler.text = 'hi'
    tiddler.fields = {u'h\u8976': 'two'}

    assert tiddler.fields[u'h\u8976'] == 'two'

    store.put(tiddler)

    tiddler = store.get(Tiddler('two', 'abag'))
    assert tiddler.fields[u'h\u8976'] == 'two'
Exemplo n.º 13
0
def test_tiddler_fields_are_stored():
    bag = Bag('bag0')
    print 'bo ', bag.policy.owner
    store.put(bag)
    tiddler = Tiddler('feebles', bag='bag0')
    tiddler.fields = {u'field1': u'value1', u'field2': u'value2'}
    store.put(tiddler)

    tiddler_second = Tiddler('feebles', bag='bag0')
    tiddler_second = store.get(tiddler_second)
    assert tiddler_second.fields['field1'] == 'value1'
    assert tiddler_second.fields['field2'] == 'value2'
Exemplo n.º 14
0
def test_tiddler_fields_ignore_server():
    bag = Bag('bag0')
    store.put(bag)
    tiddler = Tiddler('serverimpostor', bag='bag0')
    tiddler.fields = {'field1': 'value1', 'server.host': 'value1', 'server.type': 'value2'}
    store.put(tiddler)

    tiddler_second = Tiddler('serverimpostor', bag='bag0')
    tiddler_second = store.get(tiddler_second)
    assert tiddler_second.fields['field1'] == 'value1'
    assert 'server.host' not in tiddler_second.fields.keys()
    assert 'server.type' not in tiddler_second.fields.keys()
def test_tiddler_field_join():
    tiddler = Tiddler("fieldtest", "fnd_public")
    tiddler.text = "hi again"
    tiddler.fields = {u"barney": u"evil", u"soup": u"good"}
    store.put(tiddler)

    tiddlers = list(store.search(u"barney:evil"))
    assert len(tiddlers) == 1
    assert tiddlers[0].title == "fieldtest"

    tiddlers = list(store.search(u"barney:evil AND soup:good"))
    assert len(tiddlers) == 1
    assert tiddlers[0].title == "fieldtest"
Exemplo n.º 16
0
def test_tiddler_fields_ignore_server():
    bag = Bag('bag0')
    store.put(bag)
    tiddler = Tiddler('server\nimpostor', bag='bag0')
    tiddler.tags = [u'foo\nbar']
    tiddler.fields = {u'field1': u'value1\nafterlinefeed', u'server.host': u'value1', u'server.type': u'value2'}
    store.put(tiddler)

    tiddler_second = Tiddler('server\nimpostor', bag='bag0')
    tiddler_second = store.get(tiddler_second)
    assert tiddler_second.fields['field1'] == 'value1\nafterlinefeed'
    assert 'server.host' not in tiddler_second.fields.keys()
    assert 'server.type' not in tiddler_second.fields.keys()
Exemplo n.º 17
0
def _create_tiddler(commit):
	tiddler = Tiddler(commit["id"])
	tiddler.bag = bag_name
	#tiddler.created = commit["timestamp"] # XXX: convert timestamp
	#tiddler.modified = tiddler.created # XXX: use time of notification?
	tiddler.modifier = commit["author"]["name"]
	tiddler.type = content_type
	tiddler.fields = {
		"uri": commit["url"],
		"files_added": _get_file_changes(commit, "added"),
		"files_removed": _get_file_changes(commit, "removed"),
		"files_modified": _get_file_changes(commit, "modified")
	}
	tiddler.text = commit["message"]
	return tiddler
Exemplo n.º 18
0
def test_tiddler_field_join():
    tiddler = Tiddler(u'fieldtest', u'fnd_public')
    tiddler.text = u'hi again'
    tiddler.fields = {
        u'barney': u'evil',
        u'soup': u'good',
    }
    store.put(tiddler)

    tiddlers = list(store.search(u'barney:evil'))
    assert len(tiddlers) == 1
    assert tiddlers[0].title == 'fieldtest'

    tiddlers = list(store.search(u'barney:evil AND soup:good'))
    assert len(tiddlers) == 1
    assert tiddlers[0].title == 'fieldtest'
Exemplo n.º 19
0
def test_tiddler_field_join():
    tiddler = Tiddler(u'fieldtest', u'fnd_public')
    tiddler.text = 'hi again'
    tiddler.fields = {
            u'barney': u'evil',
            u'soup': u'good',
    }
    store.put(tiddler)

    tiddlers = list(store.search(u'barney:evil'))
    assert len(tiddlers) == 1
    assert tiddlers[0].title == 'fieldtest'

    tiddlers = list(store.search(u'barney:evil AND soup:good'))
    assert len(tiddlers) == 1
    assert tiddlers[0].title == 'fieldtest'
Exemplo n.º 20
0
def test_tiddler_fields_ignore_server():
    bag = Bag('bag0')
    store.put(bag)
    tiddler = Tiddler('server\nimpostor', bag='bag0')
    tiddler.tags = [u'foo\nbar']
    tiddler.fields = {
        u'field1': u'value1\nafterlinefeed',
        u'server.host': u'value1',
        u'server.type': u'value2'
    }
    store.put(tiddler)

    tiddler_second = Tiddler('server\nimpostor', bag='bag0')
    tiddler_second = store.get(tiddler_second)
    assert tiddler_second.fields['field1'] == 'value1\nafterlinefeed'
    assert 'server.host' not in tiddler_second.fields.keys()
    assert 'server.type' not in tiddler_second.fields.keys()
Exemplo n.º 21
0
def test_geo_near_tiddlers():

    # forced single tidder
    tiddler = Tiddler('North Sea', bag='gitscob')
    tiddler.fields = {u'geo.lat': u'55.0', u'geo.long': u'1.9'}
    found = list(geofilters.geo_near_tiddlers(55.0, 1.9, 1.0, [tiddler]))
    assert len(found) == 1
    assert found[0].fields['_geo.proximity'] == "0.00"

    # giant's causway
    found = list(geofilters.geo_near_tiddlers(55.23636, -6.50888, 1.0, tiddlers))
    assert len(found) == 1

    # Scotland
    found = list(geofilters.geo_near_tiddlers(55.860, -3.733, 25, tiddlers, "miles"))
    assert len(found) == 2
    
    # Cornwall
    found = list(geofilters.geo_near_tiddlers(49.916, -6.41, 100, tiddlers, "miles"))
    assert len(found) == 3
Exemplo n.º 22
0
def create(name=None, owner=None, app_url=None,
        callback_url=None, logo=None):
    """
    Create a tiddler representing a client app.
    """
    if not name or not owner or not app_url or not callback_url:
        raise TypeError('name, owner, app_url and callback_url required')

    client_id = str(uuid4())
    client_secret = str(uuid4())
    client = Tiddler(client_id)
    client.modifier = owner
    client.fields = {
            'client_secret': client_secret,
            'name': name,
            'app_url': app_url,
            'callback_url': callback_url}
    if logo:
        client.fields['logo'] = logo

    return client
Exemplo n.º 23
0
def make_access_token(environ, user, client, scope='', token_type='bearer',
        expires_in=None):
    """
    Create an access token for a user from a particular client and scope.
    """
    config = environ['tiddlyweb.config']
    store = environ['tiddlyweb.store']
    bag_name = config.get('oauth.tokens_bag', 'oauth_tokens')

    code = str(uuid4())
    token = Tiddler(code, bag_name)
    token.modifier = user
    token.fields = {
            'token_type': token_type,
            'client': client,
            'scope': scope}
    if expires_in:
        token.fields['expires_in'] = expires_in

    store.put(token)

    return token
Exemplo n.º 24
0
def register_code(environ, user, client, redirect, scope=None):
    """
    Create and save a unique code for this authorization.
    """
    config = environ['tiddlyweb.config']
    store = environ['tiddlyweb.store']
    if scope is None:
        scope = []
    code = str(uuid4())

    registration = Tiddler(code)
    registration.modifier = user
    registration.fields = dict(client=client,
                               redirect_uri=redirect,
                               scope=','.join(scope))

    bag_name = config.get('oauth.registrations_bag', 'oauth_registrations')
    registration.bag = bag_name

    store.put(registration)

    return code
Exemplo n.º 25
0
def setup_testdata():
  testdata = [
    {"title":u"Whiskers","tags":["kitty","pet","cat"],"fields":{"read":"no","favecolor":"red","badfield":"z"}},
    {"title":u"Fred","tags":["dog","pet"],"fields":{"badfield":"xt","favecolor":"red"}},
    {"title":u"Chris","tags":["cat","animal","bogof"],"fields":{"badfield":"ks","favecolor":"red"}},
    {"title":u"Martin","tags":["lion"],"fields":{"badfield":"zs","favecolor":"green"}},
    {"title":u"Jerm","tags":["monkey","lolcat"],"fields":{"badfield":"z","favecolor":"green"}},
    {"title":u"Paul","tags":["dinosaur","kitty","tiger"],"fields":{"badfield":"z","favecolor":"red"}},
    {"title":u"Ben","tags":["cAt","pet"],"fields":{"badfield":"z"}},
    {"title":u"Andrew","tags":["pet","animal","kitty"],"fields":{"badfield":"z","favecolor":"blue"}}
  
  ]
  store.put(Bag("tmp"))
  tiddlers = []
  for tid in testdata:
    tiddler = Tiddler(tid["title"],"tmp")
    tiddler.fields = tid["fields"]
    tiddler.tags = tid["tags"]
    tiddlers.append(tiddler)
    store.put(tiddler)

  
  return tiddlers
Exemplo n.º 26
0
def register_code(environ, user, client, redirect, scope=None):
    """
    Create and save a unique code for this authorization.
    """
    config = environ['tiddlyweb.config']
    store = environ['tiddlyweb.store']
    if scope is None:
        scope = []
    code = str(uuid4())

    registration = Tiddler(code)
    registration.modifier = user
    registration.fields = dict(
            client=client,
            redirect_uri=redirect,
            scope=','.join(scope))

    bag_name = config.get('oauth.registrations_bag', 'oauth_registrations')
    registration.bag = bag_name

    store.put(registration)

    return code
Exemplo n.º 27
0
def make_access_token(environ,
                      user,
                      client,
                      scope='',
                      token_type='bearer',
                      expires_in=None):
    """
    Create an access token for a user from a particular client and scope.
    """
    config = environ['tiddlyweb.config']
    store = environ['tiddlyweb.store']
    bag_name = config.get('oauth.tokens_bag', 'oauth_tokens')

    code = str(uuid4())
    token = Tiddler(code, bag_name)
    token.modifier = user
    token.fields = {'token_type': token_type, 'client': client, 'scope': scope}
    if expires_in:
        token.fields['expires_in'] = expires_in

    store.put(token)

    return token
Exemplo n.º 28
0
def test_tiddler_fields_contains_stuff():
    tiddler = Tiddler('feebles')
    tiddler.fields = {u'this': u'is cool', u'so': u'is that'}
    assert tiddler.fields['this'] == 'is cool'
    assert tiddler.fields['so'] == 'is that'
Exemplo n.º 29
0
def test_tiddler_fields_contains_stuff():
    tiddler = Tiddler('feebles')
    tiddler.fields = {'this':'is cool', 'so':'is that'}
    assert tiddler.fields['this'] == 'is cool'
    assert tiddler.fields['so'] == 'is that'
Exemplo n.º 30
0
def bag():
    bag = Bag('Geekery is the Social Capital of Britain')

    tiddler = Tiddler("@moo")
    tiddler.fields = {u'geo.lat': u'51.52351', u'geo.long': u'-0.11046'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@lastfm")
    tiddler.fields = {u'geo.lat': u'51.52762', u'geo.long': u'-0.08583'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@redmonk")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("RSA")
    tiddler.fields = {u'geo.lat': u'51.509043', u'geo.long': u'-0.12215'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Giant's Causeway")
    tiddler.fields = {u'geo.lat': u'55.24083', u'geo.long': u'-6.51167'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("English Channel")
    tiddler.fields = {u'geo.lat': u'50.18361', u'geo.long': u'-0.53111'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("River Cruises")
    tiddler.fields = {u'geo.lat': u'51.50341', u'geo.long': u'-0.120527'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Tea")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("BT Centre")
    tiddler.fields = {u'geo.lat': u'51.5156', u'geo.long': u'-0.0978'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Private Eye")
    tiddler.fields = {u'geo.lat': u'51.514657', u'geo.long': u'-0.133652'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Centre Point Tower")
    tiddler.fields = {u'geo.lat': u'51.515861', u'geo.long': u'-0.129694'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Ofcom")
    tiddler.fields = {u'geo.lat': u'51.5079', u'geo.long': u'-0.0953'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Duxford")
    tiddler.fields = {u'geo.lat': u'52.09306', u'geo.long': u'0.12944'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Sinclair Research")
    tiddler.fields = {u'geo.lat': u'52.20225', u'geo.long': u'0.13357'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("BBC Micro")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Invader")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@dopplr")
    tiddler.fields = {u'geo.lat': u'51.525490', u'geo.long': u'-0.088250'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@schoolofeverything")
    tiddler.fields = {u'geo.lat': u'51.52869', u'geo.long': u'-0.05369'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@thoughtworks")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("The Source")
    tiddler.fields = {u'geo.lat': u'51.51589', u'geo.long': u'-0.12523'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Stock Exchange")
    tiddler.fields = {u'geo.lat': u'51.515', u'geo.long': u'-0.099028'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("The Barbican")
    tiddler.fields = {u'geo.lat': u'51.51917', u'geo.long': u'-0.09389'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Griffins")
    tiddler.fields = {u'geo.lat': u'51.5086', u'geo.long': u'-0.1206'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("The Gherkin")
    tiddler.fields = {u'geo.lat': u'51.51444', u'geo.long': u'-0.08028'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Rosetta Stone")
    tiddler.fields = {u'geo.lat': u'51.519444', u'geo.long': u'-0.126944'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("British Museum")
    tiddler.fields = {u'geo.lat': u'51.51944', u'geo.long': u'-0.12694'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("St Paul's Cathedral")
    tiddler.fields = {u'geo.lat': u'51.5138', u'geo.long': u'-0.098'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Baynard's Castle")
    tiddler.fields = {u'geo.lat': u'51.51139', u'geo.long': u'-0.09861'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Fleet Street")
    tiddler.fields = {u'geo.lat': u'51.51417', u'geo.long': u'-0.10889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("St Bride's")
    tiddler.fields = {u'geo.lat': u'51.51389', u'geo.long': u'-0.10583'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("NESTA")
    tiddler.fields = {u'geo.lat': u'51.516525', u'geo.long': u'-0.108623'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("John Snow")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Soho")
    tiddler.fields = {u'geo.lat': u'51.513', u'geo.long': u'-0.135'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Foyles")
    tiddler.fields = {u'geo.lat': u'51.5147', u'geo.long': u'-0.1301'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@theteam")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Globe")
    tiddler.fields = {u'geo.lat': u'51.50806', u'geo.long': u'-0.09722'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Tate Modern")
    tiddler.fields = {u'geo.lat': u'51.50778', u'geo.long': u'-0.09917'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Aquarium")
    tiddler.fields = {u'geo.lat': u'51.50194', u'geo.long': u'-0.11889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Duck Tours")
    tiddler.fields = {u'geo.lat': u'51.501944', u'geo.long': u'-0.118889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Vauxhall Bridge")
    tiddler.fields = {u'geo.lat': u'51.4875', u'geo.long': u'-0.12694'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Spymaster")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Fuzzy's Grub")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@rewiredstate")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("BFI")
    tiddler.fields = {u'geo.lat': u'51.5072', u'geo.long': u'-0.1157'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Royal Festival Hall")
    tiddler.fields = {u'geo.lat': u'51.5058361', u'geo.long': u'-0.1167889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("National Theatre")
    tiddler.fields = {u'geo.lat': u'51.5071', u'geo.long': u'-0.1141'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("National Map Centre")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Horseguards Parade")
    tiddler.fields = {u'geo.lat': u'51.50401', u'geo.long': u'-0.12979'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Churchill Museum")
    tiddler.fields = {u'geo.lat': u'51.502083', u'geo.long': u'-0.129028'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@bongbot")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Westminster Abbey")
    tiddler.fields = {u'geo.lat': u'51.49944', u'geo.long': u'-0.1275'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@Osmosoft")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Royal Academy")
    tiddler.fields = {u'geo.lat': u'51.50917', u'geo.long': u'-0.13944'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Marble Arch")
    tiddler.fields = {u'geo.lat': u'51.51306', u'geo.long': u'-0.15889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Buckingham Palace")
    tiddler.fields = {u'geo.lat': u'51.501', u'geo.long': u'-0.142'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Harrods")
    tiddler.fields = {u'geo.lat': u'51.4995861', u'geo.long': u'-0.1635167'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Flat Cap Coffee Co")
    tiddler.fields = {u'geo.lat': u'51.497222', u'geo.long': u'-0.133901'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Tate Britain")
    tiddler.fields = {u'geo.lat': u'51.49083', u'geo.long': u'-0.12722'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Ranelagh Gardens")
    tiddler.fields = {u'geo.lat': u'51.48722', u'geo.long': u'-0.15528'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Natural History Museum")
    tiddler.fields = {u'geo.lat': u'51.4959833', u'geo.long': u'-0.1763722'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Charles Babbage")
    tiddler.fields = {u'geo.lat': u'51.495983', u'geo.long': u'-0.176372'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Science Museum")
    tiddler.fields = {u'geo.lat': u'51.4975', u'geo.long': u'-0.17472'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Hyde Park Corner")
    tiddler.fields = {u'geo.lat': u'51.50278', u'geo.long': u'-0.15125'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Baker Street")
    tiddler.fields = {u'geo.lat': u'51.5200', u'geo.long': u'-0.1566'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Albert Memorial")
    tiddler.fields = {u'geo.lat': u'51.5025', u'geo.long': u'-0.17778'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Battersea Power Station")
    tiddler.fields = {u'geo.lat': u'51.4818', u'geo.long': u'-0.1447'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Out of Order")
    tiddler.fields = {u'geo.lat': u'51.4103', u'geo.long': u'-0.2995'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Hay on Wye")
    tiddler.fields = {u'geo.lat': u'52.08', u'geo.long': u'-3.13'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Mappa Mundi")
    tiddler.fields = {u'geo.lat': u'52.08', u'geo.long': u'-3.13'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Torchwood")
    tiddler.fields = {u'geo.lat': u'51.48528', u'geo.long': u'-3.18667'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Severn Bore")
    tiddler.fields = {u'geo.lat': u'51.85113', u'geo.long': u'-2.32951'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Edward Jenner")
    tiddler.fields = {u'geo.lat': u'51.72204', u'geo.long': u'-2.48058'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Edward Jenner Museum")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Locks (Devizes)")
    tiddler.fields = {u'geo.lat': u'51.35253', u'geo.long': u'-2.02559'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("National Wireless Museum")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("H.M.S. Victory")
    tiddler.fields = {u'geo.lat': u'50.8018111', u'geo.long': u'-1.109583'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Dr Jekyll and Mr Hyde")
    tiddler.fields = {u'geo.lat': u'50.7196', u'geo.long': u'-1.8985'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Eden Project")
    tiddler.fields = {u'geo.lat': u'50.36194', u'geo.long': u'-4.74472'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("On the occasion of the Traveling Geeks Tarry at the B.T. Tower July XXIX")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Geekery is The Social Capital of Britain")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Golden Hind")
    tiddler.fields = {u'geo.lat': u'50.39667', u'geo.long': u'-3.51278'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Soutwarke")
    tiddler.fields = {u'geo.lat': u'51.50611', u'geo.long': u'-0.08972'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Non Such")
    tiddler.fields = {u'geo.lat': u'51.5075', u'geo.long': u'-0.0871'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Bridge")
    tiddler.fields = {u'geo.lat': u'51.50806', u'geo.long': u'-0.08778'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("H.M.S. Belfast")
    tiddler.fields = {u'geo.lat': u'51.5066611', u'geo.long': u'-0.08125'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Design Museum")
    tiddler.fields = {u'geo.lat': u'51.502766', u'geo.long': u'-0.071862'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Lemuel Gulliver")
    tiddler.fields = {u'geo.lat': u'51.502766', u'geo.long': u'-0.071862'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("SS Great Eastern")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Brunel Museum")
    tiddler.fields = {u'geo.lat': u'51.5016', u'geo.long': u'-0.0530'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Greenwich foot tunnel")
    tiddler.fields = {u'geo.lat': u'51.4866', u'geo.long': u'-0.0093'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Thames Barrier")
    tiddler.fields = {u'geo.lat': u'51.497744', u'geo.long': u'0.036679'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Crossness Pumping Station")
    tiddler.fields = {u'geo.lat': u'51.509056', u'geo.long': u'0.13833'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Millennium Dome")
    tiddler.fields = {u'geo.lat': u'51.5028167', u'geo.long': u'0.0031167'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("National Maritime Museum")
    tiddler.fields = {u'geo.lat': u'51.48111', u'geo.long': u'-0.00556'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Greenwich Observatory")
    tiddler.fields = {u'geo.lat': u'51.4778111', u'geo.long': u'-0.001475'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Bunhill Fields")
    tiddler.fields = {u'geo.lat': u'51.52361', u'geo.long': u'-0.08889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("The Guardian")
    tiddler.fields = {u'geo.lat': u'51.5349', u'geo.long': u'-0.1219'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("King's Cross")
    tiddler.fields = {u'geo.lat': u'51.5321', u'geo.long': u'-0.1233'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Darth Vader's Helmet")
    tiddler.fields = {u'geo.lat': u'51.50472', u'geo.long': u'-0.07833'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Clayton Tunnel")
    tiddler.fields = {u'geo.lat': u'50.91278', u'geo.long': u'-0.15389'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Hovercraft")
    tiddler.fields = {u'geo.lat': u'50.183611', u'geo.long': u'-0.531111'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Radar")
    tiddler.fields = {u'geo.lat': u'50.87', u'geo.long': u'0.346111'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Southwold Pier")
    tiddler.fields = {u'geo.lat': u'52.32993', u'geo.long': u'1.68538'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("National Railway Museum (York)")
    tiddler.fields = {u'geo.lat': u'53.95980', u'geo.long': u'-1.09771'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Fylingdales")
    tiddler.fields = {u'geo.lat': u'54.3616', u'geo.long': u'-0.6697'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Whitby (Dracula)")
    tiddler.fields = {u'geo.lat': u'54.4858', u'geo.long': u'-0.6206'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Angel of the North")
    tiddler.fields = {u'geo.lat': u'54.914111', u'geo.long': u'-1.589417'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Southwark Bridge")
    tiddler.fields = {u'geo.lat': u'51.50889', u'geo.long': u'-0.09444'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Alexander Flemming")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Planetarium")
    tiddler.fields = {u'geo.lat': u'51.52278', u'geo.long': u'-0.15556'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Beamish Museum")
    tiddler.fields = {u'geo.lat': u'54.88194', u'geo.long': u'-1.65833'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Gerry Anderson")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Lacock Abbey")
    tiddler.fields = {u'geo.lat': u'51.41475', u'geo.long': u'-2.11718'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Alexandra Palace")
    tiddler.fields = {u'geo.lat': u'51.59389', u'geo.long': u'-0.13'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Stone")
    tiddler.fields = {u'geo.lat': u'51.51167', u'geo.long': u'-0.08944'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Bloomsbury")
    tiddler.fields = {u'geo.lat': u'51.5262', u'geo.long': u'-0.1178'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Stuckism")
    tiddler.fields = {u'geo.lat': u'51.271111', u'geo.long': u'0.498611'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("@clearleft")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Portmeirion")
    tiddler.fields = {u'geo.lat': u'52.91778', u'geo.long': u'-4.09293'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Baby")
    tiddler.fields = {u'geo.lat': u'52.91778', u'geo.long': u'-4.09293'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Jet Lab")
    tiddler.fields = {u'geo.lat': u'51.65917', u'geo.long': u'-1.22639'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Delia Derbyshire")
    tiddler.fields = {u'geo.lat': u'51.5260591', u'geo.long': u'-0.191014'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Bletchley Park")
    tiddler.fields = {u'geo.lat': u'51.99651', u'geo.long': u'-0.74276'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Sarah Lacy (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Tommy Flowers")
    tiddler.fields = {u'geo.lat': u'51.561629', u'geo.long': u'-0.238401'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("MI6 (Shhh!)")
    tiddler.fields = {u'geo.lat': u'51.487194', u'geo.long': u'-0.124056'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Lido")
    tiddler.fields = {u'geo.lat': u'51.43167', u'geo.long': u'-0.13917'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Chatley Heath")
    tiddler.fields = {u'geo.lat': u'51.31523', u'geo.long': u'-0.438268'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Avebury")
    tiddler.fields = {u'geo.lat': u'51.42861', u'geo.long': u'-1.85417'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Glasto")
    tiddler.fields = {u'geo.lat': u'51.155015', u'geo.long': u'-2.585598'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Banksy")
    tiddler.fields = {u'geo.lat': u'51.5402', u'geo.long': u'-2.410989'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("non ducco ui lanx")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Goonhilly")
    tiddler.fields = {u'geo.lat': u'50.04806', u'geo.long': u'-5.18194'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Porthcurno")
    tiddler.fields = {u'geo.lat': u'50.04336', u'geo.long': u'-5.65423'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Poldhu")
    tiddler.fields = {u'geo.lat': u'50.033', u'geo.long': u'-5.267'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("tg.whatfettle.com")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Denge Sound Mirrors")
    tiddler.fields = {u'geo.lat': u'50.95611', u'geo.long': u'0.95389'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Brighton")
    tiddler.fields = {u'geo.lat': u'50.842941', u'geo.long': u'-0.1313120'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Osmosoft")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Creative Commons (CC)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Paul Downey (psd)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Down House")
    tiddler.fields = {u'geo.lat': u'51.33100', u'geo.long': u'0.05264'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Ditchling Museum")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Derek Jarman's House, Dungeness")
    tiddler.fields = {u'geo.lat': u'50.917', u'geo.long': u'0.967'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Romney, Hythe and Dymchurch Railway")
    tiddler.fields = {u'geo.lat': u'51.033', u'geo.long': u'1'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Thunderbirds")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Kew Bridge Steam Museum")
    tiddler.fields = {u'geo.lat': u'51.4890', u'geo.long': u'-0.2904'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("BBC TV Centre")
    tiddler.fields = {u'geo.lat': u'51.51028', u'geo.long': u'-0.22611'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Zoo")
    tiddler.fields = {u'geo.lat': u'51.53556', u'geo.long': u'-0.15583'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Cerne Abbas Giant")
    tiddler.fields = {u'geo.lat': u'50.81361', u'geo.long': u'-2.47472'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Ouse Valley Viaduct")
    tiddler.fields = {u'geo.lat': u'51.03472', u'geo.long': u'-0.11444'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Atmospheric railway")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Newport Transporter Bridge")
    tiddler.fields = {u'geo.lat': u'51.57056', u'geo.long': u'-2.98583'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Mossy Bottom")
    tiddler.fields = {u'geo.lat': u'51.11833', u'geo.long': u'0.19056'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Hovercraft Museum")
    tiddler.fields = {u'geo.lat': u'50.80759', u'geo.long': u'-1.20974'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Museum of the History of Science, Oxford")
    tiddler.fields = {u'geo.lat': u'51.75443', u'geo.long': u'-1.25519'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Alan Turing")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Rutherford Appleton Laboratory")
    tiddler.fields = {u'geo.lat': u'51.57333', u'geo.long': u'-1.31472'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Bodleian Library")
    tiddler.fields = {u'geo.lat': u'51.753972', u'geo.long': u'-1.255139'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Imperial War Museum North")
    tiddler.fields = {u'geo.lat': u'53.469722', u'geo.long': u'-2.298889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Jodrell Bank Observatory")
    tiddler.fields = {u'geo.lat': u'53.23625', u'geo.long': u'-2.307139'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Sellafield")
    tiddler.fields = {u'geo.lat': u'54.4205', u'geo.long': u'-3.4975'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Hunterian Museum and Art Gallery")
    tiddler.fields = {u'geo.lat': u'55.87194', u'geo.long': u'-4.28861'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Jeff Saperstein (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Tom Foremski (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Jim 'Sky' Schuyler (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Susan Bratton (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Robert Scoble (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Meghan Asha (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Sir Tim Berners-Lee")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Adastral Park")
    tiddler.fields = {u'geo.lat': u'52.05889', u'geo.long': u'1.27889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Douglas adams")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Cleopatra's Needle")
    tiddler.fields = {u'geo.lat': u'40.7796306', u'geo.long': u'-73.9654'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Eye")
    tiddler.fields = {u'geo.lat': u'51.5033', u'geo.long': u'-0.1197'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Whitehall")
    tiddler.fields = {u'geo.lat': u'51.50417', u'geo.long': u'-0.12639'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Royal Geographical Society")
    tiddler.fields = {u'geo.lat': u'51.5013', u'geo.long': u'-0.1754'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Royal Society")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Royal Institution")
    tiddler.fields = {u'geo.lat': u'51.5098', u'geo.long': u'-0.1425'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Admiralty Arch")
    tiddler.fields = {u'geo.lat': u'51.5067583', u'geo.long': u'-0.1286917'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("British Library")
    tiddler.fields = {u'geo.lat': u'51.52944', u'geo.long': u'-0.12694'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Senate House (University of London)")
    tiddler.fields = {u'geo.lat': u'51.5210', u'geo.long': u'-0.1287'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("West End theatre")
    tiddler.fields = {u'geo.lat': u'51.51139', u'geo.long': u'-0.12806'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Lewis Carroll")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Thinktank, Birmingham")
    tiddler.fields = {u'geo.lat': u'52.4829083', u'geo.long': u'-1.8860583'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Kempton Park Steam Engines")
    tiddler.fields = {u'geo.lat': u'51.4259', u'geo.long': u'-0.4050'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("William Oughtred")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("John Foxx")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Kingsway tramway subway")
    tiddler.fields = {u'geo.lat': u'51.518361', u'geo.long': u'-0.120778'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("British Museum")
    tiddler.fields = {u'geo.lat': u'51.51944', u'geo.long': u'-0.12694'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Waltham Abbey Royal Gunpowder Mills")
    tiddler.fields = {u'geo.lat': u'51.693', u'geo.long': u'-0.009'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Elstree Studios")
    tiddler.fields = {u'geo.lat': u'51.6587', u'geo.long': u'-0.2758'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Forbidden Planet (bookstore)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Museum of Scotland")
    tiddler.fields = {u'geo.lat': u'55.94694', u'geo.long': u'-3.19056'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Dolly (sheep)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("RAF Fauld Explosion")
    tiddler.fields = {u'geo.lat': u'52.847117', u'geo.long': u'-1.730608'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("John Napier")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Gonville and Caius College, Cambridge")
    tiddler.fields = {u'geo.lat': u'52.205878', u'geo.long': u'0.117867'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Acorn Computers")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Forth Railway Bridge")
    tiddler.fields = {u'geo.lat': u'56.000421', u'geo.long': u'-3.388726'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("John Logie Baird")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Kelvedon Hatch Secret Nuclear Bunker")
    tiddler.fields = {u'geo.lat': u'51.671806', u'geo.long': u'0.256556'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Cuffley")
    tiddler.fields = {u'geo.lat': u'51.7109', u'geo.long': u'-0.1134'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Bank of England")
    tiddler.fields = {u'geo.lat': u'51.51406', u'geo.long': u'-0.08839'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Somerset House")
    tiddler.fields = {u'geo.lat': u'51.511028', u'geo.long': u'-0.117194'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Cannon Street station")
    tiddler.fields = {u'geo.lat': u'51.5104', u'geo.long': u'-0.0907'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Borough Market")
    tiddler.fields = {u'geo.lat': u'51.5049083', u'geo.long': u'-0.0910889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Westminster Bridge")
    tiddler.fields = {u'geo.lat': u'51.50083', u'geo.long': u'-0.12194'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Hungerford Bridge and Golden Jubilee Bridges")
    tiddler.fields = {u'geo.lat': u'51.50611', u'geo.long': u'-0.12'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Royal College of Surgeons of England#Hunterian Museum at the Royal College of Surgeons of England")
    tiddler.fields = {u'geo.lat': u'51.51528', u'geo.long': u'-0.11583'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Monument to the Great Fire of London")
    tiddler.fields = {u'geo.lat': u'51.51013', u'geo.long': u'-0.086001'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Lloyd's building")
    tiddler.fields = {u'geo.lat': u'51.51306', u'geo.long': u'-0.082361'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("MONIAC Computer")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("The Fish-Slapping Dance")
    tiddler.fields = {u'geo.lat': u'51.4975', u'geo.long': u'-0.174722'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Arthur Conan Doyle")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Clifford Cocks")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Lambeth Bridge")
    tiddler.fields = {u'geo.lat': u'51.49444', u'geo.long': u'-0.12306'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("J. R. R. Tolkien")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Wellcome Trust Sanger Institute")
    tiddler.fields = {u'geo.lat': u'52.083', u'geo.long': u'0.183'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Michelin House")
    tiddler.fields = {u'geo.lat': u'51.4933306', u'geo.long': u'-0.1688778'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Chelsea Bridge")
    tiddler.fields = {u'geo.lat': u'51.48472', u'geo.long': u'-0.15'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Millbank Prison")
    tiddler.fields = {u'geo.lat': u'51.49139', u'geo.long': u'-0.12889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Albert Bridge, London")
    tiddler.fields = {u'geo.lat': u'51.48222', u'geo.long': u'-0.1666667'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Battersea Bridge")
    tiddler.fields = {u'geo.lat': u'51.48111', u'geo.long': u'-0.1725'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Old Operating Theatre")
    tiddler.fields = {u'geo.lat': u'51.505', u'geo.long': u'-0.08806'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Cross Bones")
    tiddler.fields = {u'geo.lat': u'51.5042', u'geo.long': u'-0.093'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Wimbledon Windmill")
    tiddler.fields = {u'geo.lat': u'51.438', u'geo.long': u'-0.232'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("St Olave Hart Street")
    tiddler.fields = {u'geo.lat': u'51.5108444', u'geo.long': u'-0.0796889'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Docklands Light Railway")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Olympic Stadium")
    tiddler.fields = {u'geo.lat': u'51.53861', u'geo.long': u'-0.01639'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("St Katharine Docks")
    tiddler.fields = {u'geo.lat': u'51.5070', u'geo.long': u'-0.0713'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Isaac Newton")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("The Eagle (pub)")
    tiddler.fields = {u'geo.lat': u'52.204', u'geo.long': u'0.1182'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Davenports")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("BT Tower")
    tiddler.fields = {u'geo.lat': u'51.5215', u'geo.long': u'-0.1389'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("JD Lasica (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Howard Rheingold (Travelling Geeks)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Ayelet Noff (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Rushton Triangular Lodge")
    tiddler.fields = {u'geo.lat': u'52.4393', u'geo.long': u'-0.7799'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Falkirk Wheel")
    tiddler.fields = {u'geo.lat': u'56.00028', u'geo.long': u'-3.84167'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Renee Blodgett (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Craig Newmark (Travelling Geek)")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Pontcysyllte Aqueduct")
    tiddler.fields = {u'geo.lat': u'52.97053', u'geo.long': u'-3.08783'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Trafalgar Square")
    tiddler.fields = {u'geo.lat': u'51.50806', u'geo.long': u'-0.12806'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Royal Albert Hall")
    tiddler.fields = {u'geo.lat': u'51.500944', u'geo.long': u'-0.1774361'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Ironbridge")
    tiddler.fields = {u'geo.lat': u'52.627245', u'geo.long': u'-2.485533'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Beatles")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Cannon Street Railway Bridge")
    tiddler.fields = {u'geo.lat': u'51.50833', u'geo.long': u'-0.09194'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("The Tower")
    tiddler.fields = {u'geo.lat': u'51.50806', u'geo.long': u'-0.07611'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Tower Bridge")
    tiddler.fields = {u'geo.lat': u'51.50556', u'geo.long': u'-0.07556'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("St. James's Park")
    tiddler.fields = {u'geo.lat': u'51.50167', u'geo.long': u'-0.13194'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Houses of Parliament")
    tiddler.fields = {u'geo.lat': u'51.499306', u'geo.long': u'-0.12475'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London IMAX")
    tiddler.fields = {u'geo.lat': u'51.505', u'geo.long': u'-0.11361'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Waterloo Bridge")
    tiddler.fields = {u'geo.lat': u'51.50861', u'geo.long': u'-0.11694'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Charing Cross")
    tiddler.fields = {u'geo.lat': u'51.5073', u'geo.long': u'-0.12755'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Blackfriars Bridges")
    tiddler.fields = {u'geo.lat': u'51.50972', u'geo.long': u'-0.10444'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Millennium Bridge")
    tiddler.fields = {u'geo.lat': u'51.510173', u'geo.long': u'-0.098438639'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("River Thames")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Thames Estuary")
    tiddler.fields = {u'geo.lat': u'51.5', u'geo.long': u'0.583'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("North Sea")
    tiddler.fields = {u'geo.lat': u'55', u'geo.long': u'1.9'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Irish Sea")
    tiddler.fields = {u'geo.lat': u'53.72167', u'geo.long': u'-5.17722'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Ley Lines")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Radio Broadcasting")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("The City")
    tiddler.fields = {u'geo.lat': u'51.5155', u'geo.long': u'-0.0922'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Buzby")
    tiddler.fields = {u'geo.lat': u'', u'geo.long': u''}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("London Transport Museum")
    tiddler.fields = {u'geo.lat': u'51.51194', u'geo.long': u'-0.12167'}
    bag.add_tiddler(tiddler);
    tiddler = Tiddler("Tottenham Court Road")
    tiddler.fields = {u'geo.lat': u'51.5207', u'geo.long': u'-0.1345'}
    bag.add_tiddler(tiddler);

    return bag
Exemplo n.º 31
0
def setup(store):
  try:
    store.delete(Bag(votebag))
  except NoBagError:
    pass
  snowwhitebag = Bag("snow white")
  snowwhitebag.policy = Policy("jon",[],['admin'],['admin'],['admin'])
  mrmenbag = Bag("mr_and_mrs")
  mrmenbag.policy = Policy("jon",["jon","andrew","martin"],['admin'],['admin'],['admin'])
  films = Bag("films")
  films.policy = Policy(accept=["NONE"])
  try:
    store.delete(mrmenbag)
  except NoBagError:
    pass
  try:
    store.delete(snowwhitebag)
  except NoBagError:
    pass
  try:
    store.delete(films)
  except NoBagError:
    pass
  voting.setup_store(config)
  users = ["jon","FND","andrew","martin"]
  for user in users:
    store.put(User(user))
  mrmendata = [
    {"title":u"mr clumbsy","tags":["kitty","pet","cat"],"fields":{}},
    {"title":u"mr thin","tags":["dog","pet"],"fields":{}},
    {"title":u"mr tickle","tags":["cat","animal","bogof"],"fields":{"%s.total"%votebag:"2"}},
    {"title":u"mr messy","tags":["lion"],"fields":{}},
    {"title":u"mr strong","tags":["monkey","lolcat"],"fields":{"%s.total"%votebag:"923"}},
    {"title":u"mr tall","tags":["dinosaur","kitty","tiger"],"fields":{}},
    {"title":u"little miss naughty","tags":["cAt","pet"],"fields":{}},
    {"title":u"mr small","tags":["pet","animal","kitty"],"fields":{}}
  ]
  snowwhitedata = [
    {"title":u"snow white","tags":[],"fields":{}},
    {"title":u"grumpy","tags":[],"fields":{}}  
  ]
  filmdata = [{"title":"Kill Bill","modifier":"Ben"},{"title":"Kill Bill 2","modifier":"Ben"},{"title":"Pulp Fiction","modifier":"Ben"},{"title":"Jackie Brown","modifier":"Ben"}]
  configSnowWhite = Tiddler("config::snow white",votebag)
  configSnowWhite.text = """
increment.range::-5,30
increment.limit::2
"""
  store.put(configSnowWhite)
  store.put(snowwhitebag)
  store.put(mrmenbag)
  store.put(films)
  tiddlers = []
  for tid in mrmendata:
    tiddler = Tiddler(tid["title"],"mr_and_mrs")
    tiddler.fields = tid["fields"]
    tiddler.tags = tid["tags"]
    tiddlers.append(tiddler)
    store.put(tiddler)
  for tid in filmdata:
    tiddler = Tiddler(tid["title"],"films")
    if "modifier" in tid:
      tiddler.modifier = tid["modifier"]
    tiddlers.append(tiddler)
    store.put(tiddler)
  for tid in snowwhitedata:
    tiddler = Tiddler(tid["title"],"snow white")
    tiddler.fields = tid["fields"]
    tiddler.tags = tid["tags"]
    tiddlers.append(tiddler)
    store.put(tiddler)    
  return tiddlers
Exemplo n.º 32
0
        raise HTTP400('Missing cookie: %s' % exc)

    if cookie_secret != sha('%s%s' % (usersign, secret)).hexdigest() or usersign != tiddler_title:
        raise HTTP401()

    try:
        content_type = environ['tiddlyweb.type']
        length = environ['CONTENT_LENGTH']
        if content_type != 'application/json':
            raise HTTP415('application/json required')
        content = environ['wsgi.input'].read(int(length))
    except KeyError, exc:
        raise HTTP400('Missing content-type or content-length headers: %s' % exc)

    try:
        json_dict = simplejson.loads(content)
        mapped_user = json_dict['mapped_user']
    except (ValueError, KeyError), exc:
        raise HTTP400('Invalid input, %s' % exc)

    tiddler = Tiddler(tiddler_title, 'MAPUSER')
    tiddler.modifier = tiddler_title
    tiddler.text = ''
    tiddler.tags = []
    tiddler.fields = {'mapped_user': mapped_user}

    store.put(tiddler)

    start_response('201 Created', [('Content-Type', 'text/html; charset=UTF-8')])
    return []