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


Python WikiPage.name方法代码示例

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


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

示例1: wiki_setup

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
def wiki_setup(tc):
    wiki1 = WikiPage(tc.env)
    wiki1.name = 'TestPage'
    wiki1.text = '--'
    wiki1.save('joe', 'normal WikiPageNames', '::1', 42)

    wiki2 = WikiPage(tc.env)
    wiki2.name = 'Space 1 23'
    wiki2.text = '--'
    wiki2.save('joe', 'not a WikiPageNames', '::1', 42)

    wiki3 = WikiPage(tc.env)
    wiki3.name = u"C'est l'\xe9t\xe9"
    wiki3.text = '--'
    wiki3.save('joe', 'unicode WikiPageNames', '::1', 42)

    imt = WikiPage(tc.env)
    imt.name = u"InterMapTxt"
    imt.text = """
This is the InterMapTxt
----
{{{
MeatBall 	http://www.usemod.com/cgi-bin/mb.pl? # $1 in MeatBall...
tsvn            tsvn:
complex         http://server/$1/page/$2?format=txt  # resource $2 in $1
}}}
----
{{{
nolink          http://noweb
}}}
"""
    imt.save('joe', 'test InterWiki links', '::1', 42)
开发者ID:cyphactor,项目名称:lifecyclemanager,代码行数:34,代码来源:wikisyntax.py

示例2: wiki_setup

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
def wiki_setup(tc):
    tc.env.config.set('wiki', 'render_unsafe_content', True) # for #9712
    now = datetime.now(utc)
    wiki0 = WikiPage(tc.env)
    wiki0.name = 'Main/Sub'
    wiki0.text = '--'
    wiki0.save('joe', 'subpage', '::1', now)

    wiki1 = WikiPage(tc.env)
    wiki1.name = 'TestPage'
    wiki1.text = '--'
    wiki1.save('joe', 'normal WikiPageNames', '::1', now)

    wiki2 = WikiPage(tc.env)
    wiki2.name = 'Space 1 23'
    wiki2.text = '--'
    wiki2.save('joe', 'not a WikiPageNames', '::1', now)

    wiki3 = WikiPage(tc.env)
    wiki3.name = u"C'est l'\xe9t\xe9"
    wiki3.text = '--'
    wiki3.save('joe', 'unicode WikiPageNames', '::1', now)

    imt = WikiPage(tc.env)
    imt.name = u"InterMapTxt"
    imt.text = """
This is the InterMapTxt
----
{{{
MeatBall 	http://www.usemod.com/cgi-bin/mb.pl? # $1 in MeatBall...
tsvn            tsvn:
complex         http://server/$1/page/$2?format=txt  # resource $2 in $1
}}}
----
{{{
nolink          http://noweb
}}}
""" 
    imt.save('joe', 'test InterWiki links', '::1', now)

    w = WikiPage(tc.env)
    w.name = 'FirstLevel'
    w.text = '--'
    w.save('joe', 'first level of hierarchy', '::1', now)
    
    w = WikiPage(tc.env)
    w.name = 'FirstLevel/SecondLevel'
    w.text = '--'
    w.save('joe', 'second level of hierarchy', '::1', now)
    
    w = WikiPage(tc.env)
    w.name = 'FirstLevel/SecondLevel/ThirdLevel'
    w.text = '--'
    w.save('joe', 'third level of hierarchy', '::1', now)
    
    w = WikiPage(tc.env)
    w.name = 'FirstLevel/SecondLevel/OtherThirdLevel'
    w.text = '--'
    w.save('joe', 'other third level of hierarchy', '::1', now)
开发者ID:zjj,项目名称:trac_hack,代码行数:61,代码来源:wikisyntax.py

示例3: add_pages

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
def add_pages(tc, names):
    now = datetime.now(utc)
    for name in names:
        w = WikiPage(tc.env)
        w.name = name
        w.text = '--'
        w.save('joe', 'the page ' + name, '::1', now)
开发者ID:wiraqutra,项目名称:photrackjp,代码行数:9,代码来源:macros.py

示例4: setUp

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
 def setUp(self):
     wiki = WikiPage(self.env)
     wiki.name = 'WikiStart'
     wiki.text = '--'
     wiki.save('joe', 'Entry page', '::1', datetime.now(utc))
     if self._setup:
         self._setup(self)
开发者ID:moreati,项目名称:trac-gitsvn,代码行数:9,代码来源:formatter.py

示例5: setUp

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
    def setUp(self):
        ProductResourceTestCase.setUp(self)

        page = WikiPage(self.global_env)
        page.name = 'TestPage'
        page.text = 'Bla bla'
        t = datetime(2001, 1, 1, 1, 1, 1, 0, utc)
        page.save('joe', 'Testing global', '::1', t)
        page.text = 'Bla bla bla'
        t = datetime(2002, 2, 2, 2, 2, 2, 0, utc)
        page.save('joe', 'Testing global 2', '::1', t)

        page = WikiPage(self.env1)
        page.name = 'TestPage'
        page.text = 'alb alB'
        t = datetime(2011, 1, 1, 1, 1, 1, 0, utc)
        page.save('mary', 'Testing product', '::1', t)
        page.text = 'Bla bla bla'
        t = datetime(2012, 2, 2, 2, 2, 2, 0, utc)
        page.save('mary', 'Testing product 2', '::1', t)
开发者ID:mohsadki,项目名称:dargest,代码行数:22,代码来源:resource.py

示例6: wiki_setup

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
def wiki_setup(tc):
    tc.env = EnvironmentStub(default_data=True,
                             enable=['trac.*', 'tractags.*'])
    tc.env.path = tempfile.mkdtemp()
    tc.db_mgr = DatabaseManager(tc.env)
    tc.db = tc.env.get_db_cnx()

    cursor = tc.db.cursor()
    cursor.execute("DROP TABLE IF EXISTS tags")
    cursor.execute("DROP TABLE IF EXISTS tags_change")
    cursor.execute("DELETE FROM system WHERE name='tags_version'")
    cursor.execute("DELETE FROM permission WHERE action %s"
                   % tc.db.like(), ('TAGS_%',))

    TagSetup(tc.env).upgrade_environment(tc.db)

    now = datetime.now(utc)
    wiki = WikiPage(tc.env)
    wiki.name = 'TestPage'
    wiki.text = '--'
    wiki.save('joe', 'TagsPluginTestPage', '::1', now)

    cursor = tc.db.cursor()
    # Populate table with initial test data.
    cursor.executemany("""
        INSERT INTO tags
               (tagspace, name, tag)
        VALUES (%s,%s,%s)
    """, [('wiki', 'TestPage', '2ndtag'),
          ('wiki', 'TestPage', 'a.really?_\wild-thing'),
          ('wiki', 'TestPage', 'heavily-quoted'),
          ('wiki', 'TestPage', 'onetag'),
          ('wiki', 'TestPage', 'tagged'),
          ('wiki', 'TestPage', "single'quote"),
         ])

    req = Mock(href=Href('/'), abs_href=Href('http://www.example.com/'),
               authname='anonymous', perm=MockPerm(), tz=utc, args={},
               locale=locale_en)
    tc.env.href = req.href
    tc.env.abs_href = req.abs_href
    tc.context = Context.from_request(req)
    # Enable big diff output.
    tc.maxDiff = None
开发者ID:kzhamaji,项目名称:TracTagsPlugin,代码行数:46,代码来源:wiki.py

示例7: test_view_page_with_invalid_pattern

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
    def test_view_page_with_invalid_pattern(self):
        """Page with invalid pattern should render fine, but not allow
        an edit without correcting the invalid pattern.
        """
        text = """{{{
(?i)eventbrite\.com
(?i)sneaker(?:supplier|nice\.com
}}}"""
        page = WikiPage(self.env)
        page.text = text
        page.name = 'BadContent'
        try:
            page.save('anonymous', 'Page created.')
        except TracError:
            self.assertTrue(WikiPage(self.env, 'BadContent').exists)
        else:
            self.fail("Saving page with invalid content did not "
                      "raise a TracError.")
        req = MockRequest(self.env, authname='user', args={
            'action': 'view',
        }, path_info='/wiki/BadContent')

        data = self._dispatch_request(req)[1]

        self.assertEqual(page.text, data['text'])

        req = MockRequest(self.env, authname='user', args={
            'action': 'edit',
            'preview': True,
            'version': 1,
            'text': text
        }, method='POST', path_info='/wiki/BadContent')
        self._dispatch_request(req)

        self.assertIn('Invalid Wiki page: Error in pattern '
                      '<tt>(?i)sneaker(?:supplier|nice\\.com</tt>: '
                      '<i>unbalanced parenthesis</i>.',
                      req.chrome['warnings'])
开发者ID:Puppet-Finland,项目名称:trac,代码行数:40,代码来源:regex.py

示例8: wiki_setup

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
def wiki_setup(tc):
    tc.env = EnvironmentStub(default_data=True,
                             enable=['trac.*', 'tractags.*'])
    tc.env.path = tempfile.mkdtemp()
    tc.db_mgr = DatabaseManager(tc.env)
    tc.db = tc.env.get_db_cnx()

    TagSetup(tc.env).upgrade_environment(tc.db)

    now = datetime.now(utc)
    wiki = WikiPage(tc.env)
    wiki.name = 'TestPage'
    wiki.text = '--'
    wiki.save('joe', 'TagsPluginTestPage', '::1', now)

    req = Mock(href=Href('/'), abs_href=Href('http://www.example.com/'),
               authname='anonymous', perm=MockPerm(), tz=utc, args={},
               locale=Locale.parse('en_US') if Locale else None)
    tc.env.href = req.href
    tc.env.abs_href = req.abs_href
    tc.context = Context.from_request(req)
    # Enable big diff output.
    tc.maxDiff = None
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:25,代码来源:wiki.py

示例9: read_file

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
def read_file(name):
	text[name] = file("wiki/" + name).read().decode('utf-8')
	page = WikiPage(env)
	page.name = name
	page.text = '--'
	page.save('', '', '::1', 0)
开发者ID:GroupO,项目名称:geeqie_zas,代码行数:8,代码来源:wiki2docbook.py

示例10: wiki_setup

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
def wiki_setup(tc):
    tc.env.config.set('wiki', 'render_unsafe_content', True) # for #9712
    now = datetime.now(utc)
    wiki0 = WikiPage(tc.env)
    wiki0.name = 'Main/Sub'
    wiki0.text = '--'
    wiki0.save('joe', 'subpage', '::1', now)

    wiki1 = WikiPage(tc.env)
    wiki1.name = 'TestPage'
    wiki1.text = '--'
    wiki1.save('joe', 'normal WikiPageNames', '::1', now)

    wiki2 = WikiPage(tc.env)
    wiki2.name = 'Space 1 23'
    wiki2.text = '--'
    wiki2.save('joe', 'not a WikiPageNames', '::1', now)

    wiki3 = WikiPage(tc.env)
    wiki3.name = u"C'est l'\xe9t\xe9"
    wiki3.text = '--'
    wiki3.save('joe', 'unicode WikiPageNames', '::1', now)

    imt = WikiPage(tc.env)
    imt.name = u"InterMapTxt"
    imt.text = """
This is the InterMapTxt
----
{{{
MeatBall        http://www.usemod.com/cgi-bin/mb.pl? # $1 in MeatBall...
tsvn            tsvn:
complex         http://server/$1/page/$2?format=txt  # resource $2 in $1
over            http://unused/? # Overridden in trac.ini
js              javascript:
javasc          javasc
}}}
----
{{{
nolink          http://noweb
}}}
"""
    imt.save('joe', 'test InterWiki links', '::1', now)
    tc.env.config.set('interwiki', 'inter',
                      'http://inter/$1/page/$2 Resource $2 in $1')
    tc.env.config.set('interwiki', 'over',
                      'http://over/$1/page/$2')

    w = WikiPage(tc.env)
    w.name = 'FirstLevel'
    w.text = '--'
    w.save('joe', 'first level of hierarchy', '::1', now)

    w = WikiPage(tc.env)
    w.name = 'FirstLevel/SecondLevel'
    w.text = '--'
    w.save('joe', 'second level of hierarchy', '::1', now)

    w = WikiPage(tc.env)
    w.name = 'FirstLevel/SecondLevel/ThirdLevel'
    w.text = '--'
    w.save('joe', 'third level of hierarchy', '::1', now)

    w = WikiPage(tc.env)
    w.name = 'FirstLevel/SecondLevel/OtherThirdLevel'
    w.text = '--'
    w.save('joe', 'other third level of hierarchy', '::1', now)

    tc.env.db_transaction("INSERT INTO ticket (id) VALUES ('123')")
开发者ID:pkdevbox,项目名称:trac,代码行数:70,代码来源:wikisyntax.py

示例11: _create_a_wiki_page

# 需要导入模块: from trac.wiki.model import WikiPage [as 别名]
# 或者: from trac.wiki.model.WikiPage import name [as 别名]
 def _create_a_wiki_page(self):
     page = WikiPage(self.env)
     page.text = '<comp5 pet cat>'
     page.name = 'TestPage'
     page.version = '1'
     return page
开发者ID:cyphactor,项目名称:lifecyclemanager,代码行数:8,代码来源:cache.py


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