当前位置: 首页>>代码示例>>Python>>正文


Python Tiddler.modifier方法代码示例

本文整理汇总了Python中tiddlyweb.model.tiddler.Tiddler.modifier方法的典型用法代码示例。如果您正苦于以下问题:Python Tiddler.modifier方法的具体用法?Python Tiddler.modifier怎么用?Python Tiddler.modifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tiddlyweb.model.tiddler.Tiddler的用法示例。


在下文中一共展示了Tiddler.modifier方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_store

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def test_store():
    """
    An exploratory test to learn how this stuff works.
    """
    bag = Bag(u'bar')
    bag.policy.owner = u'cdent'
    bag.policy.read = [u'cdent']
    store.put(bag)

    sbag = store.storage.session.query(sql.sBag).filter(sql.sBag.name == u'bar').one()
    assert sbag.name == bag.name
    assert sbag.policy.owner == bag.policy.owner
    assert sbag.policy.read == u'["cdent"]'

    bag_d = Bag(u'bar')
    bag_d = store.get(bag_d)

    assert bag_d.name == bag.name
    assert bag_d.policy.owner == bag.policy.owner
    assert bag_d.policy.read == bag.policy.read

    tiddler = Tiddler(u'tidlname', bag.name)
    tiddler.text = u'foo'
    tiddler.modifier = u'nancy'
    store.put(tiddler)

    stiddler = store.storage.session.query(sql.sTiddler).filter(sql.sTiddler.title == u'tidlname').filter(sql.sTiddler.bag_name == u'bar').one()
    assert stiddler.title == 'tidlname'
    assert stiddler.bag_name == 'bar'
    assert len(stiddler.revisions) == 1

    tiddler = Tiddler(u'tidlname', bag.name)
    tiddler.text = u'foo1'
    tiddler.modifier = u'karl'
    store.put(tiddler)

    stiddler = store.storage.session.query(sql.sTiddler).filter(sql.sTiddler.title == u'tidlname').filter(sql.sTiddler.bag_name == u'bar').one()
    assert stiddler.title == u'tidlname'
    assert stiddler.bag_name == u'bar'
    assert len(stiddler.revisions) == 2


    tiddler_d = Tiddler(u'tidlname', u'bar')
    tiddler_d = store.get(tiddler_d)

    assert tiddler_d.text == tiddler.text
    assert tiddler_d.modifier == u'karl'
    assert tiddler_d.creator == u'nancy'

    tiddlers = store.list_tiddler_revisions(tiddler_d)
    assert len(tiddlers) == 2

    store.delete(tiddler_d)
开发者ID:FND,项目名称:tiddlyweb-plugins-1,代码行数:55,代码来源:test_simple.py

示例2: test_modified

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def test_modified():
    """
    Note the multiple store.put in here are to create
    additional revisions to make sure that joins are
    sufficiently limited.
    """
    tiddler = Tiddler("GettingStarted", "fnd_public")
    tiddler.modifier = u"fnd"
    store.put(tiddler)

    tiddlers = list(store.search(u"modifier:fnd"))

    assert len(tiddlers) == 1

    tiddler = Tiddler("GettingStarted", "fnd_public")
    tiddler.tags = [u"monkey", u"cow", u"food"]
    tiddler.modifier = u"cdent"
    store.put(tiddler)
    store.put(tiddler)
    store.put(tiddler)
    store.put(tiddler)

    tiddlers = list(store.search(u"modifier:fnd"))

    assert len(tiddlers) == 0

    tiddler = Tiddler("GettingFancy", "fnd_public")
    tiddler.tags = [u"cow", u"food"]
    tiddler.modifier = u"fnd"
    store.put(tiddler)
    store.put(tiddler)
    store.put(tiddler)
    store.put(tiddler)

    tiddlers = list(store.search(u"modifier:fnd OR modifier:cdent"))

    assert len(tiddlers) == 2

    tiddlers = list(store.search(u"modifier:fnd NOT modifier:cdent"))

    assert len(tiddlers) == 1

    tiddlers = list(store.search(u"modifier:fnd NOT (modifier:cdent OR title:GettingStarted)"))

    assert len(tiddlers) == 1

    tiddlers = list(store.search(u"modifier:fnd AND modified:20*"))

    assert len(tiddlers) == 1
开发者ID:tiddlyweb,项目名称:tiddlywebplugins.sqlalchemy,代码行数:51,代码来源:test_search.py

示例3: test_modified

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def test_modified():
    """
    Note the multiple store.put in here are to create
    additional revisions to make sure that joins are
    sufficiently limited.
    """
    tiddler = Tiddler(u'GettingStarted', u'fnd_public')
    tiddler.modifier = u'fnd';
    store.put(tiddler)

    tiddlers = list(store.search(u'modifier:fnd'))

    assert len(tiddlers) == 1

    tiddler = Tiddler(u'GettingStarted', u'fnd_public')
    tiddler.tags = [u'monkey', u'cow', u'food']
    tiddler.modifier = u'cdent';
    store.put(tiddler)
    store.put(tiddler)
    store.put(tiddler)
    store.put(tiddler)

    tiddlers = list(store.search(u'modifier:fnd'))

    assert len(tiddlers) == 0

    tiddler = Tiddler(u'GettingFancy', u'fnd_public')
    tiddler.tags = [u'cow', u'food']
    tiddler.modifier = u'fnd';
    store.put(tiddler)
    store.put(tiddler)
    store.put(tiddler)
    store.put(tiddler)

    tiddlers = list(store.search(u'modifier:fnd OR modifier:cdent'))

    assert len(tiddlers) == 2

    tiddlers = list(store.search(u'modifier:fnd NOT modifier:cdent'))

    assert len(tiddlers) == 1

    tiddlers = list(store.search(u'modifier:fnd NOT (modifier:cdent OR title:GettingStarted)'))

    assert len(tiddlers) == 1

    tiddlers = list(store.search(u'modifier:fnd AND modified:20*'))

    assert len(tiddlers) == 1
开发者ID:tiddlyweb,项目名称:tiddlywebplugins.mysql,代码行数:51,代码来源:test_search.py

示例4: test_tiddler_full_create

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def test_tiddler_full_create():
    """
    Confirm we can populate a tiddler at create time.
    """

    tiddler = Tiddler('test tiddler')
    tiddler.modifier = '[email protected]'
    tiddler.text = test_tiddler_text
    tiddler.tags = ['foo', 'bar']
    tiddler.bag = u'bagone'

    assert type(tiddler) == Tiddler, \
            'Tiddler returns a Tiddler'
    assert tiddler.title == 'test tiddler', \
            'tiddler title should be test tiddler, got %s' \
            % tiddler.title
    assert tiddler.modifier == '[email protected]', \
            'tiddler modifier should [email protected], got %s' \
            % tiddler.modifier
    assert tiddler.text == test_tiddler_text, \
            'tiddler content is correct'
    assert tiddler.tags == ['foo', 'bar'], \
            'tiddler tags are correct'
    assert tiddler.bag == 'bagone', \
            'tiddler has a bag of bagone'
    assert tiddler.revision is None, \
            'tiddler revision is None'
    assert tiddler.creator == '[email protected]'
开发者ID:tup,项目名称:tiddlyweb,代码行数:30,代码来源:test_tiddler.py

示例5: test_get_profile_html

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def test_get_profile_html():
    response, content = http.request('http://0.0.0.0:8080/profiles/cdent')
    # the lack of a profile tiddler indicates you don't want to
    # participate
    assert response['status'] == '404', content

    tiddler = Tiddler('profile', 'cdent_public')
    tiddler.text = '#Hello There\n[[monkey]]'
    tiddler.type = 'text/x-markdown'
    tiddler.modifier = 'cdent'
    store.put(tiddler)

    response, content = http.request('http://0.0.0.0:8080/profiles/cdent')
    assert response['status'] == '200', content

    assert 'Hello There' in content
    assert 'http://cdent.0.0.0.0:8080/profile' in content
    assert '<li><a href="http://cdent.0.0.0.0:8080/profile">profile</a></li>' in content
    assert '<base href="http://cdent.0.0.0.0:8080/"' in content
    assert '<p><a class="wikilink" href="monkey">monkey</a></p>' in content

    response, content = http.request('http://cdent.0.0.0.0:8080/profiles/cdent')
    assert response['status'] == '404', content
    assert 'No profiles at this host' in content

    response, content = http.request('http://0.0.0.0:8080/profiles/notexist')
    assert response['status'] == '404', content
    assert 'Profile not found for notexist' in content
开发者ID:Alanchi,项目名称:tiddlyspace,代码行数:30,代码来源:test_web_finger.py

示例6: test_html_attribute_escape_with_bag

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def test_html_attribute_escape_with_bag():
    tiddler = Tiddler('escape "double" quotes in tiddler field values')
    tiddler.bag = 'foo "bar" baz'
    tiddler.modifier = 'Chris "sensei" Dent'
    tiddler.tags = ["foo", 'xxx "yyy" zzz']
    tiddler.fields["custom"] = u"""lorem 'ipsum' dolor "sit" amet"""
    tiddler.text = ''
    serializer = Serializer('tiddlywebwiki.serialization', environ)
    serializer.object = tiddler
    string = serializer.to_string()

    assert ('title="escape &quot;double&quot; quotes in tiddler field values"'
        in string)
    assert ('server.title="escape &quot;double&quot; quotes in tiddler '
        'field values"' in string)
    assert 'bag="foo &quot;bar&quot; baz"' in string
    assert 'server.workspace="bags/foo &quot;bar&quot; baz"' in string
    assert 'modifier="Chris &quot;sensei&quot; Dent"' in string
    assert 'creator="Chris &quot;sensei&quot; Dent"' in string
    assert 'tags="foo [[xxx &quot;yyy&quot; zzz]]"' in string
    assert '''custom="lorem 'ipsum' dolor &quot;sit&quot; amet"''' in string
    # single tiddler's browse link is that tiddler in its bag
    assert ('you may still <a href="/bags/foo%20%22bar%22%20baz/tiddlers/'
            'escape%20%22double%22%20quotes%20in%20tiddler%20field%20'
            'values">browse' in string)
开发者ID:tiddlyweb,项目名称:tiddlywebwiki,代码行数:27,代码来源:test_serialize_tiddler.py

示例7: process_email

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
  def process_email(self,fromAddress,toAddress,subject,body):
    title,tags = self.get_tags_and_title(subject)

    tiddler = Tiddler(title)
    tiddler.tags = tags
    tiddler.modifier = fromAddress
    tiddler.text =body
    return tiddler
开发者ID:FND,项目名称:tiddlywiki-svn-mirror,代码行数:10,代码来源:getmail_flavours.py

示例8: test_collection

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def test_collection():
    tiddlers = Tiddlers()
    tiddler = Tiddler('foo', 'null')
    tiddler.text = 'bam'
    tiddler.modifier = 'cdent'
    tiddlers.add(tiddler)
    tiddler = Tiddler('bar', 'null')
    tiddler.text = 'zoom'
    tiddler.modifier = 'cdent'
    tiddlers.add(tiddler)

    output = serializer.list_tiddlers(tiddlers)

    assert '<name>cdent</name>' in output
    assert '<uri>http://0.0.0.0:8080/profiles/cdent</uri>' in output
    assert '<link href="http://pubsubhubbub.appspot.com/" rel="hub">' in output
    assert 'rel="avatar"' in output, output
开发者ID:tiddlyweb,项目名称:tiddlywebplugins.atom,代码行数:19,代码来源:test_author_handling.py

示例9: add_email

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def add_email(environ, start_response):
    user = get_user_object(environ)
    store = environ['tiddlyweb.store']
    ensure_user_bag(store, user['name'])
    tiddler = Tiddler('email', user['name'])
    email = environ['tiddlyweb.query'].get('email', [''])[0]
    tiddler.text = email
    tiddler.modifier = user['name']
    store.put(tiddler)
    raise HTTP303('%s/home' % server_base_url(environ))
开发者ID:ralphbtp,项目名称:tiddlyhoster,代码行数:12,代码来源:__init__.py

示例10: setup

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
 def setup(self):
     data = yaml.load(self.value)
     self.stash['tiddlers'] = {}
     for title in data:
             tiddler = Tiddler(title)
             tiddler.modfied = data.get('modified', '')
             tiddler.tags = data.get('tags', [])
             tiddler.text = data.get('text', '')
             tiddler.modifier = data.get('modifier', '')
             self.stash['tiddlers'][title] = tiddler
开发者ID:ingydotnet,项目名称:tiddlyweb,代码行数:12,代码来源:testmlbridge.py

示例11: create_test_data

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def create_test_data():
    testbag = Bag(name='testbag')

    WikiTextTiddler = Tiddler('WikiTextTiddler')
    WikiTextTiddler.modifier = 'WikiAuthor'
    WikiTextTiddler.text = u"A ''tiddler'' //with// {{{wikitext}}}"
    WikiTextTiddler.bag = testbag.name

    store = _get_store()
    store.put(testbag)
    store.put(WikiTextTiddler)
开发者ID:TiddlySpace,项目名称:tiddlywebplugins.twikified,代码行数:13,代码来源:fixtures.py

示例12: _regular_tiddler

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def _regular_tiddler(environ, bag_name, input_file, target_name):
    store = environ['tiddlyweb.store']
    username = environ['tiddlyweb.usersign']['name']

    content = input_file.file.read()

    tiddler = Tiddler(target_name, bag_name)
    tiddler.text = content.decode('utf-8')
    tiddler.modifier = username
    tiddler.type = input_file.type
    store.put(tiddler)

    return tiddler
开发者ID:BillSeitz,项目名称:tank,代码行数:15,代码来源:closet.py

示例13: test_tiddler_creation_info

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def test_tiddler_creation_info():
    bag = Bag('alpha')
    STORE.put(bag)

    tiddler = Tiddler('Foo', bag.name)
    tiddler.text = 'lorem ipsum'
    tiddler.modifier = 'john'
    tiddler.modified = '20130119150632'
    STORE.put(tiddler)

    tiddler = Tiddler('Foo', bag.name)
    tiddler.text = 'lorem ipsum\ndolor sit amet'
    tiddler.modifier = 'jane'
    tiddler.modified = '20130119151021'
    STORE.put(tiddler)

    tiddler = Tiddler('Foo', bag.name)
    tiddler = STORE.get(tiddler)
    assert tiddler.creator == 'john'
    assert tiddler.modifier == 'jane'
    assert tiddler.created != tiddler.modified
    assert len(tiddler.created) == 14
    assert len(tiddler.fields) == 0
开发者ID:FND,项目名称:tiddlywebplugins.gitstore,代码行数:25,代码来源:test_tiddler.py

示例14: _binary_tiddler

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
def _binary_tiddler(environ, bag_name, input_file, target_name):
    store = environ['tiddlyweb.store']
    username = environ['tiddlyweb.usersign']['name']

    binary_storage = BinaryDisk(environ, input_file)
    url = binary_storage.store()

    tiddler = Tiddler(target_name, bag_name)
    tiddler.fields['_canonical_uri'] = url
    tiddler.modifier = username
    tiddler.type = input_file.type
    store.put(tiddler)

    return tiddler
开发者ID:BillSeitz,项目名称:tank,代码行数:16,代码来源:closet.py

示例15: add_github_gist_tiddler

# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import modifier [as 别名]
 def add_github_gist_tiddler(self, repo):
     tiddler = Tiddler('GitHubGist' + str(repo.id), 'github')
     tiddler.text = repo.description
     tiddler.tags = ['gitHubGist']
     tiddler.fields['sort_field'] = self.get_date_string(repo.updated_at)
     tiddler.fields['sort_date'] = repo.updated_at
     tiddler.fields['created_at'] = repo.created_at
     tiddler.fields['updated_at'] = repo.updated_at
     tiddler.fields['item_summary'] = repo.description
     tiddler.fields['item_url'] = repo.html_url
     tiddler.modifier = 'LifeStreamDataLoader'
     update = self.do_update(tiddler)
     if update:
         self.store.put(tiddler)
开发者ID:BoyCook,项目名称:LifeStreamTW,代码行数:16,代码来源:Loader.py


注:本文中的tiddlyweb.model.tiddler.Tiddler.modifier方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。